Allow search for IP addresses within range #1156

Closed
opened 2025-12-29 16:29:34 +01:00 by adam · 2 comments
Owner

Originally created by @candlerb on GitHub (Aug 9, 2017).

Issue type: Enhancement

Python version: 2.7.12
NetBox version: 2.1.2

Oddly, I find I cannot search for addresses within a range.

For example: I want to search for all IPAddress objects "192.168.7.x". Doing a search for 192.168.7.0/24 either in global search or in IP Address search returns no results.

Of course, if there exists a prefix object 192.168.7.0/24 then it's fine: I find the prefix, and then look at the child addresses of that prefix.

This means there is an ugly workaround:

  • Create a temporary prefix for the range you want to search for
  • Find child addresses of that prefix
  • Delete the prefix

But that isn't available to read-only users, and involves unnecessary database changes.

Originally created by @candlerb on GitHub (Aug 9, 2017). ### Issue type: Enhancement **Python version:** 2.7.12 **NetBox version:** 2.1.2 Oddly, I find I cannot search for addresses within a range. For example: I want to search for all IPAddress objects "192.168.7.x". Doing a search for `192.168.7.0/24` either in global search or in IP Address search returns no results. Of course, if there exists a *prefix* object `192.168.7.0/24` then it's fine: I find the prefix, and then look at the child addresses of that prefix. This means there is an ugly workaround: * Create a temporary prefix for the range you want to search for * Find child addresses of that prefix * Delete the prefix But that isn't available to read-only users, and involves unnecessary database changes.
adam closed this issue 2025-12-29 16:29:34 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 9, 2017):

There is a "parent prefix" field on the search panel to the right of the IP list. Use this parent filter to search for all IPs within an arbitrary prefix. The given prefix does not need to be defined in NetBox.

/ipam/ip-addresses/?parent=192.168.7.0/24
@jeremystretch commented on GitHub (Aug 9, 2017): There is a "parent prefix" field on the search panel to the right of the IP list. Use this `parent` filter to search for all IPs within an arbitrary prefix. The given prefix does not need to be defined in NetBox. ``` /ipam/ip-addresses/?parent=192.168.7.0/24 ```
Author
Owner

@candlerb commented on GitHub (Aug 9, 2017):

OK, that works, thank you.

So a suggestion for global search: if it returns no prefixes or addresses, but the query is in the form of a prefix, then search for all addresses within that prefix.

@candlerb commented on GitHub (Aug 9, 2017): OK, that works, thank you. So a suggestion for global search: if it returns no prefixes or addresses, but the query is in the form of a prefix, then search for all addresses within that prefix.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1156