2.5GBASE-T and 5GBASE-T speeds support on Interfaces #11143

Closed
opened 2025-12-29 21:40:55 +01:00 by adam · 4 comments
Owner

Originally created by @m0nkeyc0de on GitHub (May 8, 2025).

Originally assigned to: @pheus on GitHub.

NetBox version

v.4.3.0

Feature type

Data model extension

Proposed functionality

Currently InterfaceSpeecChoices do not support 2.5GBASE-T and 5GBASE-T speeds:

class InterfaceSpeedChoices(ChoiceSet):
    key = 'Interface.speed'

    CHOICES = [
        (10000, '10 Mbps'),
        (100000, '100 Mbps'),
        (1000000, '1 Gbps'),
        (10000000, '10 Gbps'),
        (25000000, '25 Gbps'),
        (40000000, '40 Gbps'),
        (100000000, '100 Gbps'),
        (200000000, '200 Gbps'),
        (400000000, '400 Gbps'),
    ]

I suggest to modify it the following way so we could be able to set the correct speeds on Netbox Interfaces.

class InterfaceSpeedChoices(ChoiceSet):
    key = 'Interface.speed'

    CHOICES = [
        (10000, '10 Mbps'),
        (100000, '100 Mbps'),
        (1000000, '1 Gbps'),
        (2500000, '2.5 Gbps'),
        (5000000, '5 Gbps'),
        (10000000, '10 Gbps'),
        (25000000, '25 Gbps'),
        (40000000, '40 Gbps'),
        (100000000, '100 Gbps'),
        (200000000, '200 Gbps'),
        (400000000, '400 Gbps'),
    ]

Use case

2.5GBASE-T and 5GBASE-T speeds already exist in InterfaceTypeChoices but this only represent the actual hardware.

The operating speed could be something else and once this modification is implemented, 2.5Gbps and 5Gbps speeds could be documented as well on the interfaces.

This would also make easier to reuse this class for API input validation in projects using Netbox as source of truth.

Database changes

No DB change (I guess)

External dependencies

No external dependencies

Originally created by @m0nkeyc0de on GitHub (May 8, 2025). Originally assigned to: @pheus on GitHub. ### NetBox version v.4.3.0 ### Feature type Data model extension ### Proposed functionality Currently [InterfaceSpeecChoices](https://github.com/netbox-community/netbox/blob/6665810a6dbd8a34828fc6f6c39484a6661789ed/netbox/dcim/choices.py#L1234) do not support 2.5GBASE-T and 5GBASE-T speeds: ```python class InterfaceSpeedChoices(ChoiceSet): key = 'Interface.speed' CHOICES = [ (10000, '10 Mbps'), (100000, '100 Mbps'), (1000000, '1 Gbps'), (10000000, '10 Gbps'), (25000000, '25 Gbps'), (40000000, '40 Gbps'), (100000000, '100 Gbps'), (200000000, '200 Gbps'), (400000000, '400 Gbps'), ] ``` I suggest to modify it the following way so we could be able to set the correct speeds on Netbox Interfaces. ```python class InterfaceSpeedChoices(ChoiceSet): key = 'Interface.speed' CHOICES = [ (10000, '10 Mbps'), (100000, '100 Mbps'), (1000000, '1 Gbps'), (2500000, '2.5 Gbps'), (5000000, '5 Gbps'), (10000000, '10 Gbps'), (25000000, '25 Gbps'), (40000000, '40 Gbps'), (100000000, '100 Gbps'), (200000000, '200 Gbps'), (400000000, '400 Gbps'), ] ``` ### Use case 2.5GBASE-T and 5GBASE-T speeds already exist in [InterfaceTypeChoices](https://github.com/netbox-community/netbox/blob/6665810a6dbd8a34828fc6f6c39484a6661789ed/netbox/dcim/choices.py#L863) but this only represent the actual hardware. The operating speed could be something else and once this modification is implemented, 2.5Gbps and 5Gbps speeds could be documented as well on the interfaces. This would also make easier to reuse this class for API input validation in projects using Netbox as source of truth. ### Database changes No DB change (I guess) ### External dependencies No external dependencies
adam added the status: acceptedtype: featurecomplexity: low labels 2025-12-29 21:40:55 +01:00
adam closed this issue 2025-12-29 21:40:55 +01:00
Author
Owner

@pheus commented on GitHub (May 8, 2025):

Thanks for the suggestion!

Just as a bit of background: the speed field in NetBox does allow any valid integer value to be entered — the defined choices are primarily for convenience and UI support. Also, administrators can customize these values via configuration if needed. For reference:
https://netboxlabs.com/docs/netbox/en/stable/configuration/data-validation/

That said, 2.5GBASE-T and 5GBASE-T are becoming increasingly common, and adding them to the default choices would likely be helpful for many users. It seems like a reasonable and low-risk enhancement to improve usability.

Just to clarify, I'm not a maintainer — so it's ultimately up to the NetBox team to decide if this gets included.

@pheus commented on GitHub (May 8, 2025): Thanks for the suggestion! Just as a bit of background: the `speed` field in NetBox does allow any valid integer value to be entered — the defined choices are primarily for convenience and UI support. Also, administrators can customize these values via configuration if needed. For reference: [https://netboxlabs.com/docs/netbox/en/stable/configuration/data-validation/](https://netboxlabs.com/docs/netbox/en/stable/configuration/data-validation/) That said, 2.5GBASE-T and 5GBASE-T are becoming increasingly common, and adding them to the default choices would likely be helpful for many users. It seems like a reasonable and low-risk enhancement to improve usability. Just to clarify, I'm not a maintainer — so it's ultimately up to the NetBox team to decide if this gets included.
Author
Owner

@m0nkeyc0de commented on GitHub (May 8, 2025):

@pheus we can effectively enter any integer value for speed, and then it's also correctly displayed:

Image

I saw the 2.5G and 5G speeds missing in the list as I'm using the Choice classes to validate data I'm sending to the API. I even don't thought to have a look in the UI.

I'm not sure if InterfaceSpeedChoices is used somewhere in the GUI as we can enter any discrete value in the Interface detail.

Image

@m0nkeyc0de commented on GitHub (May 8, 2025): @pheus we can effectively enter any integer value for `speed`, and then it's also correctly displayed: ![Image](https://github.com/user-attachments/assets/f52f61ff-3249-4128-94da-604b68c7ac21) I saw the 2.5G and 5G speeds missing in the list as I'm using the Choice classes to validate data I'm sending to the API. I even don't thought to have a look in the UI. I'm not sure if `InterfaceSpeedChoices` is used somewhere in the GUI as we can enter any discrete value in the Interface detail. ![Image](https://github.com/user-attachments/assets/8c12fb25-8366-41d2-a83c-ed04f76006c1)
Author
Owner

@pheus commented on GitHub (May 8, 2025):

Understood. Then I suggest adding the API validation as your use case in the feature request — that context helps clarify the value of extending the InterfaceSpeedChoices.

Regarding the UI: in your second screenshot, there's a small arrow next to the integer input field. Clicking that will show a dropdown with the values defined in the ChoiceSet, which can be useful for quick selection.

@pheus commented on GitHub (May 8, 2025): Understood. Then I suggest adding the API validation as your use case in the feature request — that context helps clarify the value of extending the `InterfaceSpeedChoices`. Regarding the UI: in your second screenshot, there's a small arrow next to the integer input field. Clicking that will show a dropdown with the values defined in the `ChoiceSet`, which can be useful for quick selection.
Author
Owner

@pheus commented on GitHub (May 8, 2025):

I'd be happy to contribute this. Would it be possible to assign the issue to me?

Thanks!

@pheus commented on GitHub (May 8, 2025): I'd be happy to contribute this. Would it be possible to assign the issue to me? Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11143