Enforce VLAN scoping and allow scope type of device #6008

Closed
opened 2025-12-29 19:35:39 +01:00 by adam · 4 comments
Owner

Originally created by @BrunoBlanes on GitHub (Jan 27, 2022).

NetBox version

v3.1.6

Feature type

Change to existing functionality

Proposed functionality

  • Enforce VLAN scope by not allowing range overlap if one or more groups are assigned to the same scope. (i.e. two groups assigned to scope rack and the same rack);
  • Create the scope device and allow assigning VLAN groups to devices.

Use case

We use the so called "blackhole VLANs" as the native VLAN for ports that only have a tagged VLAN associated with them and as such they only exist within the scope of said device, hence the need for the new scope.

Enforcing the scope/range combination would allow you to create multiple groups for all devices that need them, but not allow you to reuse the same VLAN within that device.

This scales well as you would, for example, have a group for a particular site, it shouldn't allow you to create a new group scoped to the same site with the same VLAN range.

Database changes

Probably will need a new field to link VLAN groups to devices, but I haven't taken a deep dive into the current database structure to say with 100% certainty.

External dependencies

No response

Originally created by @BrunoBlanes on GitHub (Jan 27, 2022). ### NetBox version v3.1.6 ### Feature type Change to existing functionality ### Proposed functionality - Enforce VLAN scope by not allowing range overlap if one or more groups are assigned to the same scope. (i.e. two groups assigned to scope rack and the same rack); - Create the scope `device` and allow assigning VLAN groups to devices. ### Use case We use the so called "blackhole VLANs" as the native VLAN for ports that only have a tagged VLAN associated with them and as such they only exist within the scope of said device, hence the need for the new scope. Enforcing the scope/range combination would allow you to create multiple groups for all devices that need them, but not allow you to reuse the same VLAN within that device. This scales well as you would, for example, have a group for a particular site, it shouldn't allow you to create a new group scoped to the same site with the same VLAN range. ### Database changes Probably will need a new field to link VLAN groups to devices, but I haven't taken a deep dive into the current database structure to say with 100% certainty. ### External dependencies _No response_
adam added the type: featurepending closure labels 2025-12-29 19:35:39 +01:00
adam closed this issue 2025-12-29 19:35:39 +01:00
Author
Owner

@BrunoBlanes commented on GitHub (Jan 27, 2022):

I should point out that this is taking into consideration this #8168 issue that implements the range as a feature.

@BrunoBlanes commented on GitHub (Jan 27, 2022): I should point out that this is taking into consideration this #8168 issue that implements the range as a feature.
Author
Owner

@BrunoBlanes commented on GitHub (Jan 27, 2022):

Now that I'm thinking about it, it would make sense to rename "VLAN Group" to "VLAN Range" and add a "VLAN Group" to be purely organizational with a parent field, for example:

  • VLAN Group
    -- Name: BKHL
    -- Parent: None
    -- Description: Blackhole VLANs
    -- Tags: None

  • VLAN Group
    -- Name: BKHL-VTA01
    -- Parent: BKHL
    -- Description: Newport Blackhole VLANs
    -- Tags: None

  • VLAN Range
    -- Name: BKHL-VTA01-SWT-01
    -- VLAN Group: BKHL-VTA01
    -- Scope type: DCIM > device
    -- Device: VTA01-SWT-01

  • VLAN
    -- Range scope: Device
    -- VLAN Range: BKHL-VTA01-SWT-01

@BrunoBlanes commented on GitHub (Jan 27, 2022): Now that I'm thinking about it, it would make sense to rename "VLAN Group" to "VLAN Range" and add a "VLAN Group" to be purely organizational with a parent field, for example: - VLAN Group -- Name: `BKHL` -- Parent: `None` -- Description: `Blackhole VLANs` -- Tags: `None` - VLAN Group -- Name: `BKHL-VTA01` -- Parent: `BKHL` -- Description: `Newport Blackhole VLANs` -- Tags: `None` - VLAN Range -- Name: `BKHL-VTA01-SWT-01` -- VLAN Group: `BKHL-VTA01` -- Scope type: `DCIM > device` -- Device: `VTA01-SWT-01` - VLAN -- Range scope: `Device` -- VLAN Range: `BKHL-VTA01-SWT-01`
Author
Owner

@github-actions[bot] commented on GitHub (Mar 29, 2022):

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.

@github-actions[bot] commented on GitHub (Mar 29, 2022): 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](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Apr 30, 2022):

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.

@github-actions[bot] commented on GitHub (Apr 30, 2022): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6008