VLAN Groups enhancement - Allow assignments of VLANs to multiple groups #1661

Closed
opened 2025-12-29 16:34:07 +01:00 by adam · 3 comments
Owner

Originally created by @jsenecal on GitHub (Apr 6, 2018).

Issue type

[X] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: Python 3.5.2
  • NetBox version: Develop branch 07364ab

Description

It would be great if it was possible to assign a vlan to multiple groups. This would allow for more efficient filtering when assigning vlans to interfaces in the UI and better grouping of such vlans for documentation purposes.

For instance, I can have vlan "Data(10), Voice(11)" assigned to the "Firewall" Vlan group but then, the same vlans are later grouped along with different Vlans on a "Switches" Vlan group. I.e: Along with "Security(20)"

ipam/models.py#L562 should be replaced to a ManyToMany relationship and relevant forms modified to allow this.

Makes sense?

Originally created by @jsenecal on GitHub (Apr 6, 2018). ### Issue type [X] Feature request [ ] Bug report [ ] Documentation <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) If you are submitting a bug report and have made any changes to the code base, please first validate that your bug can be recreated while running an official release. --> ### Environment * Python version: Python 3.5.2 <!-- Example: 3.5.4 --> * NetBox version: Develop branch [07364ab](https://github.com/digitalocean/netbox/commit/07364abf9e9ff193bad49b790e657382cf186f0c)<!-- Example: 2.1.3 --> <!-- BUG REPORTS must include: * A list of the steps needed for someone else to reproduce the bug * A description of the expected and observed behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description It would be great if it was possible to assign a vlan to multiple groups. This would allow for more efficient filtering when assigning vlans to interfaces in the UI and better grouping of such vlans for documentation purposes. For instance, I can have vlan "Data(10), Voice(11)" assigned to the "Firewall" Vlan group but then, the same vlans are later grouped along with different Vlans on a "Switches" Vlan group. I.e: Along with "Security(20)" [ipam/models.py#L562](https://github.com/digitalocean/netbox/blob/develop/netbox/ipam/models.py#L562) should be replaced to a ManyToMany relationship and relevant forms modified to allow this. Makes sense?
adam closed this issue 2025-12-29 16:34:07 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 12, 2018):

Groups are used to enforce uniqueness among VLAN IDs. For example, a group cannot have two VLANs with VID 100. Allowing a VLAN to be assigned to multiple groups would remove (or at best greatly complicate) this functionality.

@jeremystretch commented on GitHub (Apr 12, 2018): Groups are used to enforce uniqueness among VLAN IDs. For example, a group cannot have two VLANs with VID 100. Allowing a VLAN to be assigned to multiple groups would remove (or at best greatly complicate) this functionality.
Author
Owner

@jsenecal commented on GitHub (Apr 16, 2018):

I do not see why this ability could prevent or complicate the enforcement of uniqueness among VLAN IDs in a group as the uniqueness in any group would still be a requirement, the added feature only enables one to have a specific VLAN object available to be made member to more than one group.

Maybe my explanation was not clear enough, I could work on a PR and submit it for evaluation ?

@jsenecal commented on GitHub (Apr 16, 2018): I do not see why this ability could prevent or complicate the enforcement of uniqueness among VLAN IDs in a group as the uniqueness in any group would still be a requirement, the added feature only enables one to have a specific VLAN object available to be made member to more than one group. Maybe my explanation was not clear enough, I could work on a PR and submit it for evaluation ?
Author
Owner

@clinta commented on GitHub (Jun 13, 2019):

To bump this, here's the usecase where I would like this feature.

We have two datacenters with a layer 2 connection between them. VLAN groups can enforce unique VLANs inside each datacenter. But the one VLAN that holds the cross datacenter connection must not conflict with VLANs in either datacenter, so it would be useful if this VLAN could exist in both groups.

@clinta commented on GitHub (Jun 13, 2019): To bump this, here's the usecase where I would like this feature. We have two datacenters with a layer 2 connection between them. VLAN groups can enforce unique VLANs inside each datacenter. But the one VLAN that holds the cross datacenter connection must not conflict with VLANs in either datacenter, so it would be useful if this VLAN could exist in both groups.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1661