Netbox: Search missing prefixes

Created on 11 Jul 2019  路  7Comments  路  Source: netbox-community/netbox

Environment

  • Python version: 2.7.13
  • NetBox version: 2.5.13

Steps to Reproduce

  1. Add a new prefix : 10.200.0.0/24
  2. Add a new prefix : 10.200.2.0/24
  3. Search "10.200"

What did you expect to happen?

Search result show both 2 added prefixes 10.200.0.0/24 and 10.200.2.0/24

What happened instead?

Search result show only one prefix 10.200.0.0/24

All 7 comments

This is not a bug. When searching by prefix, the provided ID is cast as a prefix. In this example, "10.200" is interpreted as "10.200.0.0", which is why 10.200.2.0 is not matched.

I could have swore this worked before, did this get changed recently? Would we maybe want to not cast it as a prefix?

Just checked this on an old v2.5.0, worked the same way then.

Add new :

  • prefix 10.200.0.0/24
  • prefix 10.200.2.0/24
  • IP address 10.200.0.1/24
  • IP address 10.200.2.0124

Then search "10.200", results are :

  • prefix 10.200.0.0/24
  • IP address 10.200.0.1/24
  • IP address 10.200.2.1/24

There you miss the prefix 10.200.2.0/24, and you get the IP address 10.200.2.1/24 which match the missed prefix.

Prefixes search behavior is not the same as IP addresses search, looks like a bug to me, at least confusing for user.

How to search all prefixes and IP addresses matching 10.200.*.* ?

Did this have to be a search functionality evolution ?

could you just search 10.200.0.0/22 or something larger?

could you just search 10.200.0.0/22 or something larger?

"10.200.0.0/22" search response is :

  • no prefix
  • no IP address
  • 1 aggregate 10.200.0.0/22

"10.200.0.0/8" search response is : "no result found"

You want the "search within" field located directly below the general search field on the prefixes list. For example, ?within_include=10.200.0.0/22 will return all prefixes within 10.200.0.0/22 (as well as 10.200.0.0/22 itself, if it exists).

One search, two behaviors, depending if it applies to prefixes/aggregates or ip addresses.
Looks like a bug to me, but if you decide it is a "functionality" so it is.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

billyzoellers picture billyzoellers  路  3Comments

aarjbdea picture aarjbdea  路  3Comments

mrfroggg picture mrfroggg  路  3Comments

hoalex picture hoalex  路  3Comments

bellwood picture bellwood  路  3Comments