Add VLANs to Devices #4894

Closed
opened 2025-12-29 19:21:45 +01:00 by adam · 6 comments
Owner

Originally created by @avidpontoon on GitHub (May 10, 2021).

NetBox version

v2.11.3

Feature type

Data model extension

Proposed functionality

Within each Device, you should be able to assign VLANs to it. Much like you can do on an interface. Allowing you to track which devices have which VLANs on them. This should then be displayed somewhere within the 'Device' tab to view at a glance.

Use case

Allowing users to immediately know if a certain device already has a specified VLAN on it or if it needs adding. Could also mean that when you go to assign VLANs to interfaces on a specific device, it only shows VLANs that are configured on that specific device. This could help with accidentally assigning a VLAN that isn't on the device.

Database changes

New VLAN ID's field would be required for devices.

External dependencies

None

Originally created by @avidpontoon on GitHub (May 10, 2021). ### NetBox version v2.11.3 ### Feature type Data model extension ### Proposed functionality Within each Device, you should be able to assign VLANs to it. Much like you can do on an interface. Allowing you to track which devices have which VLANs on them. This should then be displayed somewhere within the 'Device' tab to view at a glance. ### Use case Allowing users to immediately know if a certain device already has a specified VLAN on it or if it needs adding. Could also mean that when you go to assign VLANs to interfaces on a specific device, it only shows VLANs that are configured on that specific device. This could help with accidentally assigning a VLAN that isn't on the device. ### Database changes New VLAN ID's field would be required for devices. ### External dependencies None
adam added the type: feature label 2025-12-29 19:21:45 +01:00
adam closed this issue 2025-12-29 19:21:45 +01:00
Author
Owner

@romanstech commented on GitHub (May 10, 2021):

Agree with this request. Yesterday started thinking where I can save such info on each switch in Netbox.

@romanstech commented on GitHub (May 10, 2021): Agree with this request. Yesterday started thinking where I can save such info on each switch in Netbox.
Author
Owner

@TheNetworkGuy commented on GitHub (May 11, 2021):

Do not agree with this feature request. VLAN's are interface specific, not device specific.

Besides you can look at the interface overview to see all assigned VLAN's to all interfaces, call the API for a list of VLAN's etc.

@TheNetworkGuy commented on GitHub (May 11, 2021): Do not agree with this feature request. VLAN's are interface specific, not device specific. Besides you can look at the interface overview to see all assigned VLAN's to all interfaces, call the API for a list of VLAN's etc.
Author
Owner

@jeremystretch commented on GitHub (May 11, 2021):

VLANs are difficult to model effectively. While we do "create" VLANs on switches, what we're really doing is partitioning the L2 forwarding table into discrete domains. In reality, VLANs are really link-specific. For example, I can create subinterfaces Gi0/0.100 and Gi0/1.100 both using 802.1Q encapsulation tagged for VLAN 100, but these aren't necessarily in the same VLAN.

Also, NetBox v2.11 introduced the available_on_device and available_on_virtualmachine filters which largely obviate the need for the direct assignment proposed here.

@jeremystretch commented on GitHub (May 11, 2021): VLANs are difficult to model effectively. While we do "create" VLANs on switches, what we're really doing is partitioning the L2 forwarding table into discrete domains. In reality, VLANs are really link-specific. For example, I can create subinterfaces Gi0/0.100 and Gi0/1.100 both using 802.1Q encapsulation tagged for VLAN 100, but these aren't necessarily in the same VLAN. Also, NetBox v2.11 introduced the `available_on_device` and `available_on_virtualmachine` filters which largely obviate the need for the direct assignment proposed here.
Author
Owner

@avidpontoon commented on GitHub (May 11, 2021):

Hi Jeremy,

Is there any documentation on the available_on_device addition?

Thanks
Nick

@avidpontoon commented on GitHub (May 11, 2021): Hi Jeremy, Is there any documentation on the available_on_device addition? Thanks Nick
Author
Owner

@jeremystretch commented on GitHub (May 12, 2021):

It's listed as an available filter in the REST API docs, but that's about it.

@jeremystretch commented on GitHub (May 12, 2021): It's listed as an available filter in the REST API docs, but that's about it.
Author
Owner

@jeremystretch commented on GitHub (May 12, 2021):

I'm going to go ahead and close this as it would only serve to complicate the data model at this point.

@jeremystretch commented on GitHub (May 12, 2021): I'm going to go ahead and close this as it would only serve to complicate the data model at this point.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4894