searching doesnt show multiple ip ranges in search results #4192

Closed
opened 2025-12-29 18:33:46 +01:00 by adam · 2 comments
Owner

Originally created by @biohazd on GitHub (Oct 16, 2020).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.8.3

Steps to Reproduce

  1. Type in part of an ip address in search box on the top of the page "e.g. 10.92.164"
  2. The results only show one range, namely "10.92.164.0/23" it doesn show the 2nd range I have of "10.92.164.32/28". This smaller range is inside the large one.

Expected Behavior

the search results should show both IP ranges.

  • 10.92.164.0/23
  • 10.92.164.32/28

Observed Behavior

The results only show one range, namely "10.92.164.0/23" it doesn show the 2nd range I have of "10.92.164.32/28". This smaller range is inside the large one.

Originally created by @biohazd on GitHub (Oct 16, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/g/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report, and that any plugins have been disabled. --> ### Environment * Python version: 3.6.8 * NetBox version: 2.8.3 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox. Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a client library such as pynetbox. --> ### Steps to Reproduce 1. Type in part of an ip address in search box on the top of the page "e.g. 10.92.164" 2. The results only show one range, namely "10.92.164.0/23" it doesn show the 2nd range I have of "10.92.164.32/28". This smaller range is inside the large one. <!-- What did you expect to happen? --> ### Expected Behavior the search results should show both IP ranges. - 10.92.164.0/23 - 10.92.164.32/28 <!-- What happened instead? --> ### Observed Behavior The results only show one range, namely "10.92.164.0/23" it doesn show the 2nd range I have of "10.92.164.32/28". This smaller range is inside the large one.
adam closed this issue 2025-12-29 18:33:46 +01:00
Author
Owner

@biohazd commented on GitHub (Oct 16, 2020):

Following on from this, the smaller range is set as a "child" range, so maybe thats why it doesnt show up in search results.

@biohazd commented on GitHub (Oct 16, 2020): Following on from this, the smaller range is set as a "child" range, so maybe thats why it doesnt show up in search results.
Author
Owner

@jeremystretch commented on GitHub (Oct 16, 2020):

This is expected behavior, as has been explained in prior issues. NetBox does not do naive character matching on IP addresses, because network boundaries often do not coincide with dotted-decimal notation. (For instance, character matching doesn't allow searching for all prefixes within 192.168.0.0/20.) Instead, use the "search within" field in the search form, which corresponds to the within_include query filter. This will return all prefixes contained by a given prefix (which may or may not be defined in NetBox.)

@jeremystretch commented on GitHub (Oct 16, 2020): This is expected behavior, as has been explained in prior issues. NetBox does not do naive character matching on IP addresses, because network boundaries often do not coincide with dotted-decimal notation. (For instance, character matching doesn't allow searching for all prefixes within 192.168.0.0/20.) Instead, use the "search within" field in the search form, which corresponds to the `within_include` query filter. This will return all prefixes contained by a given prefix (which may or may not be defined in NetBox.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4192