mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-11 21:10:29 +01:00
Restore ability to collapse prefix hierarchy to uppermost level #4123
Closed
opened 2025-12-29 18:33:17 +01:00 by adam
·
28 comments
No Branch/Tag Specified
main
update-changelog-comments-docs
feature-removal-issue-type
20911-dropdown
20239-plugin-menu-classes-mutable-state
21097-graphql-id-lookups
feature
fix_module_substitution
20923-dcim-templates
20044-elevation-stuck-lightmode
feature-ip-prefix-link
v4.5-beta1-release
20068-import-moduletype-attrs
20766-fix-german-translation-code-literals
20378-del-script
7604-filter-modifiers-v3
circuit-swap
12318-case-insensitive-uniqueness
20637-improve-device-q-filter
20660-script-load
19724-graphql
20614-update-ruff
14884-script
02496-max-page
19720-macaddress-interface-generic-relation
19408-circuit-terminations-export-templates
20203-openapi-check
fix-19669-api-image-download
7604-filter-modifiers
19275-fixes-interface-bulk-edit
fix-17794-get_field_value_return_list
11507-show-aggregate-and-rir-on-api
9583-add_column_specific_search_field_to_tables
v4.5.0
v4.4.10
v4.4.9
v4.5.0-beta1
v4.4.8
v4.4.7
v4.4.6
v4.4.5
v4.4.4
v4.4.3
v4.4.2
v4.4.1
v4.4.0
v4.3.7
v4.4.0-beta1
v4.3.6
v4.3.5
v4.3.4
v4.3.3
v4.3.2
v4.3.1
v4.3.0
v4.2.9
v4.3.0-beta2
v4.2.8
v4.3.0-beta1
v4.2.7
v4.2.6
v4.2.5
v4.2.4
v4.2.3
v4.2.2
v4.2.1
v4.2.0
v4.1.11
v4.1.10
v4.1.9
v4.1.8
v4.2-beta1
v4.1.7
v4.1.6
v4.1.5
v4.1.4
v4.1.3
v4.1.2
v4.1.1
v4.1.0
v4.0.11
v4.0.10
v4.0.9
v4.1-beta1
v4.0.8
v4.0.7
v4.0.6
v4.0.5
v4.0.3
v4.0.2
v4.0.1
v4.0.0
v3.7.8
v3.7.7
v4.0-beta2
v3.7.6
v3.7.5
v4.0-beta1
v3.7.4
v3.7.3
v3.7.2
v3.7.1
v3.7.0
v3.6.9
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.3-r1
v1.0.3
1.0.0
Labels
Clear labels
beta
breaking change
complexity: high
complexity: low
complexity: medium
needs milestone
netbox
pending closure
plugin candidate
pull-request
severity: high
severity: low
severity: medium
status: accepted
status: backlog
status: blocked
status: duplicate
status: needs owner
status: needs triage
status: revisions needed
status: under review
topic: GraphQL
topic: Internationalization
topic: OpenAPI
topic: UI/UX
topic: cabling
topic: event rules
topic: htmx navigation
topic: industrialization
topic: migrations
topic: plugins
topic: scripts
topic: templating
topic: testing
type: bug
type: deprecation
type: documentation
type: feature
type: housekeeping
type: translation
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/netbox#4123
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @marbarmar on GitHub (Sep 21, 2020).
Environment
Buttons Collapse and Expand are missing in 2.9.3 netbox while they were present in 2.8 version of netbox
Proposed Functionality
Collapse and expand buttons would collapse/expand the view of prefixes so we will see only parent subnets on top of our network hierarchy (in case of collapse) or see all networks (in case of expand).
Use Case
We do manual search in Netbox Prefixes quiet often. We need to do this searches hierarchically, which mean start from the parent super-net and follow through parent networks down to end device subnet. Without collapse and expand button this became more difficult.
Also opening Prefixes in collapsed form is more lucid and we do see the hirerarchy of most parent subnets.
Database Changes
no database changes are expected
External Dependencies
no external dependencies are expected
@jeremystretch commented on GitHub (Sep 21, 2020):
This change was necessary to greatly improve performance when rendering the prefixes list; please see #4639.
This is still possible in NetBox, both from the list view and from an individual prefix.
@marbarmar commented on GitHub (Sep 22, 2020):
Hello and thank you for your update.
I do understand that listing all prefixes without dealing with depth improved the response speed.
Would it be possible to add Collapse and Expand button back and while listing prefixes (IPAM > Prefixes) we will get the output the netbox 2.9.3 is currently giving (expanded) but using those buttons (Collapse/Expand) we will get the collapsed/expanded output as before?
This will get the the same results while listing prefixes but we will have the option to get collapsed output.
As I have described we quiet often open prefix, lets say /12, under which there are lots of /22s and under each there are host subnets /24, /25, /28, etc. Hierarchical listing is what we really need to go through and find what we are looking for.
Getting those buttons back would help us a lot.
If this is not an option for you than at least we need to see all subnets in Prefixes even those which are unassigned. Currently if I open lets say prefix 10.0.0.0/12 I do see all assigned prefixes and their child prefixes but I do see ONLY unassigned/available prefixes which are directly under 10.0.0.0/12.
For example if there is child prefix 10.0.4.0/22 under which there are lots of /28 prefixes and some of them are available I do not see those when going to IPAM > Prefixes.
This makes finding Available network almost impossible. We just have to go manually through all prefixes and hope to find one with some unassigned/available child prefix.
@jeremystretch commented on GitHub (Sep 22, 2020):
Any work toward this feature would need to be accomplished without sacrificing the performance gains achieved under #4639. @marbarmar are you interested in volunteering to own this work?
@Joezeppe commented on GitHub (Sep 26, 2020):
I am looking into potential solutions and will try to come back with an implementation without sacrificing the performance gains achieved under #4639.
@jeremystretch commented on GitHub (Sep 28, 2020):
Assigning to @Joezeppe. Please follow-up with your progress within a few weeks.
@jeremystretch commented on GitHub (Oct 30, 2020):
@Joezeppe have you been able to make any progress with this?
@vladsol commented on GitHub (Oct 30, 2020):
upvote!
Navigation with 600+ prefixes is not very confortable :)
@jeremystretch commented on GitHub (Oct 30, 2020):
I honestly don't understand the problems some people complain about with the current implementation. I have around 15K prefixes loaded into a development instance and I much prefer the current approach to the old, slow rendering.
@vladsol commented on GitHub (Oct 30, 2020):
You scroll through all of the 100 ... pages to find the prefix you want? :) You have a lot of free time :)
@jeremystretch commented on GitHub (Oct 30, 2020):
No, I filter for it. For example, if I want to see all prefixes within
10.16.128.0/17(whether or not that has been created as a prefix in NetBox), I type "10.16.128/17" into the "search within" box, and get only those prefixes. From there, I can use the "max length" selector to omit lower tiers if desired. This makes it very convenient to carve out a specific view with both upper and lower bounds, and was not possible prior to v2.9.@itdependsnetworks commented on GitHub (Oct 30, 2020):
I am thinking about potential solutions that can keep the performant updates and all of the prior functionality.
@igloo777 commented on GitHub (Nov 20, 2020):
Hello!
How about the way it was implemented in Racktables? There we can click on aggregated prefix to "open" it's content (subnets). It allows to reduce a scope of search (as it implemented with "search within"), and adds simplicity in some cases (for some people it's much simple to do 3-4 clicks than type a prefix; personally I would like to have the both possibilities).
@jeremystretch commented on GitHub (Nov 25, 2020):
Removing @Joezeppe as it's been two months with no updates. If no one else volunteers after some time it will be closed automatically.
@martinkiska commented on GitHub (Nov 30, 2020):
Hello, I think that this update also came up with confused display of available networks in child prefixes. When I search parent prefix I see only available subnets in that parent prefix but when this update came I started to seeing also subnets in child prefixes (it would be great if we could collapse them, as most of the time you just want to see their supernets), which make situation for zero trust concepts and small subnets very confusing. Especially when only allocated child prefixes are shown, but not available one. Please check attached picture. On left I have opened parent prefix 10.64.0.0/16 and free subnets in that prefix are displayed (note number 1). Confusing part you can see on note number 2. Even in parent prefix you display 2 used subnets, you don't show any other available subnets. From the first look 10.64.0.0/24 is full, even it is not - you just need to open that prefix in new page.
@jeremystretch commented on GitHub (Nov 30, 2020):
@martinkiska Please open a separate bug report for this as it is not related to the feature request.
@martinkiska commented on GitHub (Nov 30, 2020):
@jeremystretch thx, I will create it... I thought that it is related. Because if netbox would be able to collapse those sub prefixes of 10.64.0.0/24, we wouldn't see them and it would also resolve the issue.
@marbarmar commented on GitHub (Dec 1, 2020):
@jeremystretch the comment from @martinkiska is relevant. It is what I wrote in the use case:
Also opening Prefixes in collapsed form is more lucid and we do see the hierarchy of most parent subnets.
@jeremystretch commented on GitHub (Dec 1, 2020):
@marbarmar The display of available prefixes is a separate concern not directly related to collapsing/expanding the hierarchy of existing prefixes. It is being tracked in #5397.
@baguilar951 commented on GitHub (Dec 18, 2020):
Hello everyone,
We recently implemented Netbox for production use and I have been maintaining it as a tool for multiple teams in my organization. We upgraded from 2.8.6 to 2.9.9 and we are receiving reports from our Infrastructure teams that the ability to collapse and expand the prefixes is an easier and visual way to audit and organize the subnets within the IPAM. Although I am not a coder myself, I would like to provide testing for bringing this functionality back.
Although the prefixes can be limited to a block size and filtered thereafter, it is proving to be a vital way to visualize the hierarchy of our networks as it is for most of the people who use Netbox (our teams pretty much live in it now). The child prefix view is also problematic in it's current state because of how we carve our VPC networks in different regions across multiple cloud providers, much like @marbarmar describes with /16 supernets, /23 subnets and /28 VPCs.
What version was this changed in? If there is a way to revert to a build where the IPAM had the accordions, I would appreciate some pointers.
Thank you @jeremystretch for such an amazing project and we will continue to use this tool and support however we can.
@jeremystretch commented on GitHub (Dec 18, 2020):
Several people in the thread have made similar vague complaints, but I have yet to see anyone prescribe a specific sets of steps to reproduce a problem. The old prefix hierarchy provided only two options: show only the top-level prefixes, or show all of them. The new approach lets you filter out prefixes beyond an arbitrary length, while preserving the ability to filter by summary to carve out whatever specific view you'd like to see. This is clearly a far more flexible approach, so I'm confused as to where people are getting hung up. I suspect it may simply be a matter of educating users about the tools available to them.
@baguilar951 perhaps you can share an example of specifically where you're running into a limitation. Please be sure to detail what prefixes you've created, and what you want to see in the list.
@baguilar951 commented on GitHub (Dec 18, 2020):
Hi @jeremystretch,
In the previous version, the collpased view:

In our current version, we have a completely expanaded view of the subnets in a supernet:

I understand this may seem trivial and I would agree, being able to filter to the max CIDR length is a much logical implementation to view the hierarchy, the issue is readability. In our case some of those /22 subnets we don't need to see unless we absolutely need to drill down into them.
We would like to easily view /16s and /17s that are assigned to regions as well as determine the next available subnet without having to dig through page after page of noise. The expectation is that the default view be the top-most level of the prefixes in our environment. A choice to do either a top-level collapse and/or a CIDR length filter might be the best of both worlds for those who prefer it to be that way. I would try to come up with a solution myself but my python knowledge is limited.
@jeremystretch commented on GitHub (Dec 18, 2020):
You can easily replicate this exact view by applying the "max length" filter:
Selecting "16" will show only prefixes up to /16 in length, resulting in a view identical to your first screenshot.
@baguilar951 commented on GitHub (Dec 18, 2020):
Hi @jeremystretch,
My apologies, the screenshots are updated for the child prefix view. But the top-level collapse is the feature that is also being requested in the IPAM.
@jeremystretch commented on GitHub (Dec 18, 2020):
Please restore your original screenshot so that future readers may still have some hope of following the discussion, and make a new comment below with the correction.
@baguilar951 commented on GitHub (Dec 18, 2020):
Apologies @jeremystretch,
In the old version, the child prefix view (Note how the rest of the available /17 get rolled up into a /15):

In the new build:

@christheradioguy commented on GitHub (Dec 29, 2020):
Just wanted to chime in here with my use case for the old system.
In my situation, I have several parent prefixes (a /29, a /32, a /48 and others) and then a number of suballocations for customers below those parents. When I go into Netbox and look for my /48 parent prefix, I have to scroll through a huge number of customer /48's to find it. The 'Max Length' dropdown doesn't help me in my case because all the suballocted networks I don't want to see are also /48's so they show up regardless.
@stale[bot] commented on GitHub (Feb 13, 2021):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.
@stale[bot] commented on GitHub (Mar 5, 2021):
This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.