NetBox plugin to order interfaces more intuitively
⚠️ This plugin hacks into NetBox: This plugin definitely does not follow the supported plugin protocol, and can break NetBox!
Compatibility
This plugin in compatible with NetBox 2.8. Because of the way this plugin hacks into the internals of NetBox compatibility with other versions is not guaranteed.
Installation
First, add netbox_reorder to your /opt/netbox/local_requirements.txt file. Create it if it doesn't exist.
If you are using a local version of the plugin, for example for development, add -e /opt/path/to/plugin instead.
Then enable the plugin in /opt/netbox/netbox/netbox/configuration.py, like:
PLUGINS = [
'netbox_reorder',
]
And finally run /opt/netbox/upgrade.sh. This will download and install the plugin and update the database when necessary. Don't forget to run sudo systemctl restart netbox netbox-rq like upgrade.sh tells you!
Usage
This plugin overrides the default interface sorting algorithm of NetBox.
Ordering of mixed interface type names
Some devices (for example Juniper switches) can have mixed interface type names. By default NetBox orders these as follows:
- ge-0/0/1
- ge-0/0/3
- xe-0/0/0
- xe-0/0/2
- xe-0/0/4
- ge-0/1/1
- ge-0/1/3
- xe-0/1/0
- xe-0/1/2
- xe-0/1/4
This is because the interface type (ge or xe) has precedence over the last part of the interface name. This makes sense when using certain Cisco equipment that has both FastEthernet and GigabitEthernet interfaces with the same numbers:
- FastEthernet0/0
- FastEthernet0/1
- GigabitEthernet0/0
- GigabitEthernet0/1
NetBox has consciously chosen this sorting algorithm. This plugin implements an alternative more intuitive algorithm where the ordering will be:
- xe-0/0/0
- ge-0/0/1
- xe-0/0/2
- ge-0/0/3
- xe-0/0/4
- xe-0/1/0
- ge-0/1/1
- xe-0/1/2
- ge-0/1/3
- xe-0/1/4
The downside is that Cisco equipment with duplicate ports numbers will be less intuitive:
- FastEthernet0/0
- GigabitEthernet0/0
- FastEthernet0/1
- GigabitEthernet0/1
Ordering of virtual chassis interfaces
NetBox orders interfaces first by device name and then by name. This can cause interfaces in a virtual chassis to appear in an unexpected order. Consider for example the following virtual chassis:
| Device Name | Position | Interface names |
|---|---|---|
| one | 1 | xe-1/x/y |
| two | 2 | xe-2/x/y |
| three | 3 | xe-3/x/y |
When viewing the virtual chassis the intuitive order of interfaces would be first xe-1/x/y, then xe-2/x/y and finally xe-3/x/y.
However, because NetBox by default sorts first on device name, the order will be first xe-1/x/y, then xe-3/x/y and finally xe-2/x/y.
Why? Because "three" comes before "two" alphabetically.
This plugin patches NetBox to implement the intuitive order.
Metadata
Release files for netbox-reorder 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| netbox_reorder-1.0.1.tar.gz | 8.3 kB | Without provenance | Details for netbox_reorder-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| netbox_reorder-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for netbox_reorder-1.0.1-py3-none-any.whl |
Total release size: 17.1 kB
Release files / netbox_reorder-1.0.1.tar.gz
| Download URL | netbox_reorder-1.0.1.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
374afbe6a76934fa6d6a9a1517d492d869a79c76640a412eb3b33c0321ea5c8f
|
|
BLAKE2b-256 checksum How to use checksums |
d05d0f7781d4b63ba1e5e386517bafadc5c1ed251fb1fa39447daf24e3deefe4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
|
Release files / netbox_reorder-1.0.1-py3-none-any.whl
| Download URL | netbox_reorder-1.0.1-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86f7792ed924416d0754532d982406f60d2e090a5939a90dc95c1cf8a0cfe7de
|
|
BLAKE2b-256 checksum How to use checksums |
958452ce16578fe45b441affd2e614cb389e6d084520fc5ad133221bc6c55444
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
|
Security for netbox-reorder 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.