Switch with 48 ports and 100 tagged vLAN per port (No bulk configuration possible.) #6454

Closed
opened 2025-12-29 19:40:54 +01:00 by adam · 9 comments
Owner

Originally created by @LHBL2003 on GitHub (May 5, 2022).

NetBox version

v3.2.2

Feature type

New functionality

Proposed functionality

I have many switches with 48 ports.
There are over 100 tagged VLANs on very many ports (interfaces).
e.g. VLAN 9, 27, 101,1010, 3000-3100 etc.

Currently I don't see any way how to do a bulk configuration for each interface.

Use case

In the "802.1Q Switching" section (https://netbox-100/dcim/interfaces/25/edit/)
Only 1 VLAN can be selected in the "Tagged VLANs" field. Then the next VLAN must be selected. etc.

A mass select is helpful. So that I don't have to click 100 times for VLAN 3000 to 3100.

Database changes

No response

External dependencies

No response

2022-05-05_18h44_31

Originally created by @LHBL2003 on GitHub (May 5, 2022). ### NetBox version v3.2.2 ### Feature type New functionality ### Proposed functionality I have many switches with 48 ports. There are over 100 tagged VLANs on very many ports (interfaces). e.g. VLAN 9, 27, 101,1010, 3000-3100 etc. Currently I don't see any way how to do a bulk configuration for each interface. ### Use case In the "802.1Q Switching" section (https://netbox-100/dcim/interfaces/25/edit/) Only 1 VLAN can be selected in the "Tagged VLANs" field. Then the next VLAN must be selected. etc. A mass select is helpful. So that I don't have to click 100 times for VLAN 3000 to 3100. ### Database changes _No response_ ### External dependencies _No response_ ![2022-05-05_18h44_31](https://user-images.githubusercontent.com/46369917/166973302-e46dc64d-8ff1-4d40-b915-4dd54f5f67d3.png)
adam added the type: featurepending closurestatus: under review labels 2025-12-29 19:40:54 +01:00
adam closed this issue 2025-12-29 19:40:54 +01:00
Author
Owner

@LHBL2003 commented on GitHub (May 5, 2022):

OK, one point I hadn't thought of. I can select multiple interfaces and thus configure multiple ports for this switch at the same time. However, I have to click 100 times for each switch to start VLAN 3000-3100. I would be happy if there was a multi select for this.

@LHBL2003 commented on GitHub (May 5, 2022): OK, one point I hadn't thought of. I can select multiple interfaces and thus configure multiple ports for this switch at the same time. However, I have to click 100 times for each switch to start VLAN 3000-3100. I would be happy if there was a multi select for this.
Author
Owner

@kkthxbye-code commented on GitHub (May 6, 2022):

From a quick glance slim-select does not support shift selection. A band-aid could be disabling closeOnSelect for multiple select fields, saving at least one click per option (I'm probably gonna create a seperate FR for this regardless).

Not sure of the feasibility of adding shift-select on top of slim-select. @thatmattlove you have any input on this?

@kkthxbye-code commented on GitHub (May 6, 2022): From a quick glance [slim-select](https://github.com/brianvoe/slim-select) does not support shift selection. A band-aid could be disabling closeOnSelect for multiple select fields, saving at least one click per option (I'm probably gonna create a seperate FR for this regardless). Not sure of the feasibility of adding shift-select on top of slim-select. @thatmattlove you have any input on this?
Author
Owner

@CroogQT commented on GitHub (May 6, 2022):

I'm fairly confidant that a similar implementation to #9309 will work in this case. If that pull request is approved I'd be glad to implement this case as well.

@CroogQT commented on GitHub (May 6, 2022): I'm fairly confidant that a similar implementation to #9309 will work in this case. If that pull request is approved I'd be glad to implement this case as well.
Author
Owner

@LHBL2003 commented on GitHub (May 10, 2022):

I don't know anything about APIs yet, but I've already managed a transitional solution. I hope that a solution for everyday use will be implemented.

For the general public:
Below are a few screenshots showing how to achieve the goal via the API.
It makes my work easier and my colleagues won't behead me. If you work with NetBox for the first time :)

Still a very nice tool :)

Overview
001_Overview

Get Netbox object ID from vLAN
002_GetNetBoxObjectIdFromVLAN

Determine the NetBox path to the device interface
003_GetNetBoxPathFromInterface

Postman API configuration and first GET request
004_PostmanGetInterfaceInformations

Create PostMan VLANs for Device Interface
API Informations see: https://demo.netbox.dev/api/docs/
(Attention: Existing VLAN IDs must be taken from GET, otherwise they will be removed from the device).

Addendum: If you have not yet activated tagged mode in the configuration, you should pass this with . Otherwise the VLANs are not displayed in the NetBox editor.

{
    "mode": "tagged",
    "tagged_vlans": [7,8,9,10,11,12,13,14]
}
005_PostmanPatchNewVLANsForInterface

Done: The new VLANS have been created :-)
006_ViewNewVLANsInInterface

@LHBL2003 commented on GitHub (May 10, 2022): I don't know anything about APIs yet, but I've already managed a transitional solution. I hope that a solution for everyday use will be implemented. For the general public: Below are a few screenshots showing how to achieve the goal via the API. It makes my work easier and my colleagues won't behead me. If you work with NetBox for the first time :) Still a very nice tool :) Overview <img width="1916" alt="001_Overview" src="https://user-images.githubusercontent.com/46369917/167574410-e615e10b-f621-4967-8190-70781be69c86.png"> Get Netbox object ID from vLAN <img width="808" alt="002_GetNetBoxObjectIdFromVLAN" src="https://user-images.githubusercontent.com/46369917/167574415-159067ee-86c9-411b-ab56-fb68dc93b5c2.png"> Determine the NetBox path to the device interface <img width="793" alt="003_GetNetBoxPathFromInterface" src="https://user-images.githubusercontent.com/46369917/167574418-87775303-1386-4123-8970-2bcab5c11dc9.png"> Postman API configuration and first GET request <img width="834" alt="004_PostmanGetInterfaceInformations" src="https://user-images.githubusercontent.com/46369917/167574419-6e10b58c-de9e-4994-9bd3-ce8b9e2c8f3a.png"> Create PostMan VLANs for Device Interface API Informations see: https://demo.netbox.dev/api/docs/ (Attention: Existing VLAN IDs must be taken from GET, otherwise they will be removed from the device). Addendum: If you have not yet activated tagged mode in the configuration, you should pass this with . Otherwise the VLANs are not displayed in the NetBox editor. ``` { "mode": "tagged", "tagged_vlans": [7,8,9,10,11,12,13,14] } ``` <img width="876" alt="005_PostmanPatchNewVLANsForInterface" src="https://user-images.githubusercontent.com/46369917/167574423-ea938f19-0f78-4f82-8679-6f7d4618f625.png"> Done: The new VLANS have been created :-) <img width="1079" alt="006_ViewNewVLANsInInterface" src="https://user-images.githubusercontent.com/46369917/167574428-f68f5583-a25b-45bc-b9a0-f0b6bde5017e.png">
Author
Owner

@thatmattlove commented on GitHub (May 16, 2022):

@CroogQT - I took a look at #9309, great work there. Once that last fix is implemented I'm sure it'll be merged. For shift selecting, I'd love for you to take a crack at it but I have a feeling it might be more complicated due to all the extra stuff I've had to bolt on to SlimSelect to make it do what we need.

Would it be simpler to just set closeOnSelect to false (true by default`) when it's a multi-select? That way, you can quickly click through the options without having to re-open the select element each time. I know this isn't what the original issue asked for, but it might satisfy what @LHBL2003 and others with similar needs are looking for.

@thatmattlove commented on GitHub (May 16, 2022): @CroogQT - I took a look at #9309, great work there. Once that last fix is implemented I'm sure it'll be merged. For shift selecting, I'd love for you to take a crack at it but I have a feeling it might be more complicated due to all the extra stuff I've had to bolt on to SlimSelect to make it do what we need. Would it be simpler to just set `closeOnSelect` to `false` (`true` by default`) when it's a multi-select? That way, you can quickly click through the options without having to re-open the select element each time. I know this isn't what the original issue asked for, but it might satisfy what @LHBL2003 and others with similar needs are looking for.
Author
Owner

@LHBL2003 commented on GitHub (Jun 14, 2022):

Do I understand this correctly.
The proposal would take care of the following:

  • A VLAN is selected.
  • The VLAN list remains open.
  • The next VLAN can be selected without opening the list again.
  • the list is exited.
  • the VLan are taken over

Already this would be a strong improvement. If the implementation is much lower by ratio.

Because currently you have to open the list again and again.
And you have to scroll down again and again to continue where you left off.

@LHBL2003 commented on GitHub (Jun 14, 2022): Do I understand this correctly. The proposal would take care of the following: - A VLAN is selected. - The VLAN list remains open. - The next VLAN can be selected without opening the list again. - the list is exited. - the VLan are taken over Already this would be a strong improvement. If the implementation is much lower by ratio. Because currently you have to open the list again and again. And you have to scroll down again and again to continue where you left off.
Author
Owner

@jdavidson2021 commented on GitHub (Jul 19, 2022):

We have the same problem with it being very tedious to add vlans to interfaces on routers/switches in our environment. How difficult would it be to add the 802.1Q switching section of the interface into the csv or a yaml interface bulk import for a device and allow the 802.1Q Mode, VLAN Group, Untagged VLAN, and Tagged VLAN fields to be included in the original interface import? If you only accepted the VLAN ID's in the import it would give you a much easier way to associate VLANs to interfaces.

image

@jdavidson2021 commented on GitHub (Jul 19, 2022): We have the same problem with it being very tedious to add vlans to interfaces on routers/switches in our environment. How difficult would it be to add the 802.1Q switching section of the interface into the csv or a yaml interface bulk import for a device and allow the 802.1Q Mode, VLAN Group, Untagged VLAN, and Tagged VLAN fields to be included in the original interface import? If you only accepted the VLAN ID's in the import it would give you a much easier way to associate VLANs to interfaces. ![image](https://user-images.githubusercontent.com/82478442/179630796-50ea8445-dc71-431e-b9c8-569f5ea43bf6.png)
Author
Owner

@github-actions[bot] commented on GitHub (Sep 17, 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. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Sep 17, 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. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Oct 18, 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 (Oct 18, 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#6454