Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter VLANs in topology #280

Open
danyill opened this issue Apr 21, 2023 · 7 comments
Open

Filter VLANs in topology #280

danyill opened this issue Apr 21, 2023 · 7 comments
Labels
status: under review Further discussion is needed to determine this issue's scope and/or implementation type: feature Request for new feature or change to existing feature

Comments

@danyill
Copy link

danyill commented Apr 21, 2023

NetBox version

v3.3.9

Topology Views version

v3.1.0

Feature type

New functionality

Proposed functionality

(Thank you for this very excellent tool)

I'd like to be able to filter by VLAN in the "Filters" view.

An identical filter interface to what is shown for e.g. a device interface would be fine:

image

This would then apply to the VLAN group, Untagged VLAN and Tagged VLANs in the device/interface view.

I've seen #71 and tend to think showing the VLANs on a diagram might not be sustainable (although it would be in our application). I'd be happy for the VLANs just to be a filtering mechanism and to have no metadata associated with them in the graphical view.

Use case

It addresses the need to able to:

  • show topology associated with a particular customer which only has access to a specific VLAN
  • assist fault finding by allow prompt identification of the devices and equipment associated with a specific VLAN.

External dependencies

Unlikely to require an external dependency.

@danyill danyill added the type: feature Request for new feature or change to existing feature label Apr 21, 2023
@dreng
Copy link
Collaborator

dreng commented Apr 21, 2023

Hi danyill,

Thanks for your contribution. I'm yet not fully convinced we can handle VLANs in a proper way. As you saw #71, you know that we've had this discussion before. The Problem is that we handle devices. You'd like to handle Interfaces instead. A device may have a whole bunch of interfaces (like 48-Port switches) and may have even more VLANs.

That said, I see that your proposal is different and may be a helpful idea. I've just got one thing in my mind that regards the future: There's another feature request for inverted filters. This will be hopefully implemented upstream some day. How exactly would you treat a device if just one of the ports matches a (inverse) filtered VLAN? Would you discard this device from the topology entirely? That might lead to unexpected results.

@dreng dreng added the status: under review Further discussion is needed to determine this issue's scope and/or implementation label Apr 21, 2023
@danyill
Copy link
Author

danyill commented Apr 29, 2023

Thanks for your feedback.

I may not understand the issue and am unfamiliar with the codebase, so I'm certainly not requesting a rewrite to work at a different level of granularity.

For the purpose of this feature request:

  • Can we consider a device as having "many" VLANs by aggregating interfaces and the VLANs within them. A device "has" a VLAN if its interfaces have that VLAN. The point here is to show that there is connectivity through that device within a particular VLAN or set of VLANs
  • Then if any of the interfaces has the filtered for VLAN(s) the device is selected.
  • The device must not have the VLANs(s) for an inverted filter.

@andrei-korshikov
Copy link

@dreng Imaging 1000+ switches with more than 200 VLANs in a single STP domain (well, technically there are 200+ PVSTs in single layer-2 network, I mean all these switches are interconnected, and Layer 3 switch is only in the center of this messy network). VLANs are stretched and distributed quite randomly ("organically", as network grows). In such environment there is quite ordinary (and important!:D) task - "draw a map for that VLAN".

By the way, I know the workaround;) With Python scripts, automatically add tags for the devices based on the VLANs of their interfaces. Then filter on these tags in the Topology View)

@brodyck
Copy link

brodyck commented Sep 13, 2024

Would like to see this as well. Is there any progress?

@dreng
Copy link
Collaborator

dreng commented Sep 13, 2024

Would like to see this as well. Is there any progress?

Nope. Do you want to volunteer for a PR?

NetBox does not allow more than one filter pane. You have to submit always exact one filter stored in "filter_form". See https://github.com/netbox-community/netbox/blob/develop/netbox/templates/inc/filter_list.html

The solution must therefore be a new topology entry in the main menu with all the things that go with it.

@brodyck
Copy link

brodyck commented Sep 13, 2024

That is a bit of work! I see why this is still open. Thanks for your prompt response and this plugin.

Offering this as a solution, based on what andrei said earlier, that avoids built-in tags:

  1. Create a 'Vlan Database' custom field with at minimum:
    • 'Object types' set to 'DCIM > Devices'
    • 'type' set to 'Multiple Objects'
    • 'Related object type' set to 'IPAM > VLAN'
  2. Add the vlans to the new field in your preferred method

Then in the filters, you can go to the Vlan Database field and select the Vlans you want to filter by, all while keeping your tag list a little less clustered. This has the benefits of creating links on all your devices to vlans associated as well.

@arcreigh
Copy link

Another important consideration to keep in mind, is that a device must have the VLAN defined in addition to accepting the tagging on an interface.

If a device only accepts the tag but does not have it defined the path is not actually complete as the device itself is not aware that the VLAN exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: under review Further discussion is needed to determine this issue's scope and/or implementation type: feature Request for new feature or change to existing feature
Projects
None yet
Development

No branches or pull requests

5 participants