Increase VLAN name field to 128 chars #4875

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

Originally created by @ledgley on GitHub (May 5, 2021).

NetBox version

v2.10.5

Feature type

Change to existing functionality

Proposed functionality

Cisco Nexus switches allow configuration of VLAN long name of 128 chars. The name field under the VLAN model currently has a limit of 64 chars.

Propose to increase the max_length from 64 to 128

Use case

Attempting to use NetBox as source of truth however this is resulting in discrepancies between VLAN names in NetBox and VLAN names on the actual switches, as we have to truncate names longer than 64 chars to enter to NetBox.

Database changes

Updating max_length will require database changes

    name = models.CharField(
        max_length=64
    )

External dependencies

No response

Originally created by @ledgley on GitHub (May 5, 2021). ### NetBox version v2.10.5 ### Feature type Change to existing functionality ### Proposed functionality Cisco Nexus switches allow configuration of VLAN long name of 128 chars. The name field under the VLAN model currently has a limit of 64 chars. Propose to increase the `max_length` from 64 to 128 ### Use case Attempting to use NetBox as source of truth however this is resulting in discrepancies between VLAN names in NetBox and VLAN names on the actual switches, as we have to truncate names longer than 64 chars to enter to NetBox. ### Database changes Updating max_length will require database changes ```python name = models.CharField( max_length=64 ) ``` ### External dependencies _No response_
adam added the type: featurepending closure labels 2025-12-29 19:21:33 +01:00
adam closed this issue 2025-12-29 19:21:33 +01:00
Author
Owner

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

VLAN name length was discussed under #374 and 64 characters was determined to be suitable for real-world purposes. Many platforms actually limit this to 32 characters. I'm curious what your use case is for VLAN names greater than 64 characters in length.

@jeremystretch commented on GitHub (May 6, 2021): VLAN name length was discussed under #374 and 64 characters was determined to be suitable for real-world purposes. Many platforms actually limit this to 32 characters. I'm curious what your use case is for VLAN names greater than 64 characters in length.
Author
Owner

@ledgley commented on GitHub (May 7, 2021):

Our VLAN naming standard does not specifically state the maximum length of a VLAN name. 32 characters is generally insufficient, so vlan long-name is enabled, which allows up to 128 characters. In some cases, engineers have given names longer than 64 characters. Admittedly, this is uncommon.

The use case specific to NetBox is that we are using NetBox as the SoT for driving our automation. Discovering configured VLAN's into NetBox requires truncating of VLAN names longer than 64 characters. When we then push configuration back out (eg. existing VLAN pushed to new switch), the VLAN names on the switches are configured to the truncated version.

Obviously we can go through our environment and tidy up to reduce VLAN names to <=64 chars, though I am curious to understand from a NetBox perspective, why allowing 128 characters is not suitable, given many switching platforms do support VLAN names of this length? #374 is approaching 5 years old - can this be revisited?

@ledgley commented on GitHub (May 7, 2021): Our VLAN naming standard does not specifically state the maximum length of a VLAN name. 32 characters is generally insufficient, so vlan long-name is enabled, which allows up to 128 characters. In some cases, engineers have given names longer than 64 characters. Admittedly, this is uncommon. The use case specific to NetBox is that we are using NetBox as the SoT for driving our automation. Discovering configured VLAN's into NetBox requires truncating of VLAN names longer than 64 characters. When we then push configuration back out (eg. existing VLAN pushed to new switch), the VLAN names on the switches are configured to the truncated version. Obviously we can go through our environment and tidy up to reduce VLAN names to <=64 chars, though I am curious to understand from a NetBox perspective, why allowing 128 characters is not suitable, given many switching platforms do support VLAN names of this length? #374 is approaching 5 years old - can this be revisited?
Author
Owner

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

given many switching platforms do support VLAN names of this length

Could you give some examples of platforms that support this length? Any Cisco devices only support 32

#374 is approaching 5 years old - can this be revisited

Most definitely we can revisit it, but there needs to be some concrete proof that it is actually relevant before we go through with it.

@DanSheps commented on GitHub (May 12, 2021): > given many switching platforms do support VLAN names of this length Could you give some examples of platforms that support this length? Any Cisco devices only support 32 > #374 is approaching 5 years old - can this be revisited Most definitely we can revisit it, but there needs to be some concrete proof that it is actually relevant before we go through with it.
Author
Owner

@ledgley commented on GitHub (May 13, 2021):

Cisco NXOS supports up to 128 characters, since 6.1(1), by enabling vlan long-name. Here is the N9k guide

You can configure VLAN long-names of up to 128 characters. To configure VLAN long-names, VTP must be in transparent mode.

4500-X on IOS-XE also supports 128 characters from 3.7e

Increases the maximum characters supported in a VLAN name from 32 to 128.

3650 on IOS-XE also supports 128 characters from 3.7e

VLAN name extension: Maximum characters allowed for a VLAN name has been increased from 32 to 128.

@ledgley commented on GitHub (May 13, 2021): Cisco NXOS supports up to 128 characters, since 6.1(1), by enabling `vlan long-name`. [Here is the N9k guide](https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/6-x/layer2/configuration/guide/b_Cisco_Nexus_9000_Series_NX-OS_Layer_2_Switching_Configuration_Guide/b_Cisco_Nexus_9000_Series_NX-OS_Layer_2_Switching_Configuration_Guide_chapter_011.html) > You can configure VLAN long-names of up to 128 characters. To configure VLAN long-names, VTP must be in transparent mode. 4500-X on IOS-XE also supports 128 characters from [3.7e](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst4500/release/note/ol-37xe-4500e.html) > Increases the maximum characters supported in a VLAN name from 32 to 128. 3650 on IOS-XE also supports 128 characters from [3.7e](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst3650/software/release/3e/release_notes/rn-3dot7e-3650.html) > VLAN name extension: Maximum characters allowed for a VLAN name has been increased from 32 to 128.
Author
Owner

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

though I am curious to understand from a NetBox perspective, why allowing 128 characters is not suitable

The character limit is a sanity check. It's very difficult to imagine a legitimate use case where a VLAN's name is greater than 64 characters in length. More likely, a user who claims to need more space is trying to attach extraneous information to the name attribute, such as an IP prefix or description. NetBox has other, more robust means of storing those attributes, so a longer name should not be needed.

@jeremystretch commented on GitHub (May 13, 2021): > though I am curious to understand from a NetBox perspective, why allowing 128 characters is not suitable The character limit is a sanity check. It's very difficult to imagine a legitimate use case where a VLAN's _name_ is greater than 64 characters in length. More likely, a user who claims to need more space is trying to attach extraneous information to the name attribute, such as an IP prefix or description. NetBox has other, more robust means of storing those attributes, so a longer name should not be needed.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 13, 2021):

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 (Jul 13, 2021): 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 (Aug 12, 2021):

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 (Aug 12, 2021): 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#4875