NetBox plugin for automatic interface renaming when modules are installed
Project description
NetBox Interface Name Rules Plugin
Automatic interface renaming when modules are installed into NetBox device bays.
What it does
When a module (transceiver, line card, converter) is installed into a module bay,
NetBox creates interfaces using position-based naming from the module type template.
This often produces incorrect names — e.g., Interface 1 instead of et-0/0/4.
This plugin hooks into Django's post_save signal on the Module model to
automatically apply renaming rules based on configurable templates.
Features
- Signal-driven — rules fire automatically on module install, no manual step needed
- Template variables —
{slot},{bay_position},{bay_position_num},{base},{channel}, etc. - Arithmetic expressions —
{8 + ({parent_bay_position} - 1) * 2 + {sfp_slot}} - Breakout support — create multiple channel interfaces from a single port (e.g., QSFP+ 4x10G)
- Scoping — rules can be scoped to specific device types, parent module types, or be universal
- Bulk import/export — YAML-based rule management via the UI or API
Supported scenarios
| Scenario | Example |
|---|---|
| Converter offset | GLC-T in CVR-X2-SFP → GigabitEthernet3/10 |
| Breakout channels | QSFP-4X10G-LR → et-0/0/4:0 through et-0/0/4:3 |
| Platform naming | QSFP-100G-LR4 on ACX7024 → et-0/0/{bay_position} |
| UfiSpace breakout | QSFP-100G on S9610 → swp{bay_position_num}s{channel} |
Installation
pip install netbox-interface-name-rules
Add to configuration.py:
PLUGINS = ['netbox_interface_name_rules']
Compatibility
- NetBox ≥ 4.2.0
- Python ≥ 3.12
License
Apache 2.0
Documentation
- Full documentation — installation, configuration, examples
- DeepWiki — AI-generated codebase overview
Contributing
See CONTRIBUTING.md for how to submit code or interface name rules.
Community-contributed rules for various vendors are in the contrib/ directory.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netbox_interface_name_rules-1.2.0.tar.gz.
File metadata
- Download URL: netbox_interface_name_rules-1.2.0.tar.gz
- Upload date:
- Size: 56.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7744fbf55156e7e468e7ae258023450bf5089f89e50514c42c12b99a6b937e25
|
|
| MD5 |
cb717caac8da0e8929b468fd91a838b3
|
|
| BLAKE2b-256 |
efce882b4dfc91d7e5bb5c8d251dd82927fbd95c43610d020b86b8ca3e9d5937
|
Provenance
The following attestation bundles were made for netbox_interface_name_rules-1.2.0.tar.gz:
Publisher:
publish-pypi.yaml on marcinpsk/netbox-InterfaceNameRules-plugin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_interface_name_rules-1.2.0.tar.gz -
Subject digest:
7744fbf55156e7e468e7ae258023450bf5089f89e50514c42c12b99a6b937e25 - Sigstore transparency entry: 1006415845
- Sigstore integration time:
-
Permalink:
marcinpsk/netbox-InterfaceNameRules-plugin@a066fb5b1b223e4df10d2e25811918e74c7c84e4 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/marcinpsk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yaml@a066fb5b1b223e4df10d2e25811918e74c7c84e4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file netbox_interface_name_rules-1.2.0-py3-none-any.whl.
File metadata
- Download URL: netbox_interface_name_rules-1.2.0-py3-none-any.whl
- Upload date:
- Size: 74.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7551df204199bff0b10bbc06695658a8a3c83f8420f3259ca39ffec0ce9e6e32
|
|
| MD5 |
ab6b12f0e50faf9ac582ccc1a4c9e0b6
|
|
| BLAKE2b-256 |
08f7d40af9c70d7d54851a7296aae3c07578cd2040caa8babf5d7339ca904f33
|
Provenance
The following attestation bundles were made for netbox_interface_name_rules-1.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yaml on marcinpsk/netbox-InterfaceNameRules-plugin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_interface_name_rules-1.2.0-py3-none-any.whl -
Subject digest:
7551df204199bff0b10bbc06695658a8a3c83f8420f3259ca39ffec0ce9e6e32 - Sigstore transparency entry: 1006415849
- Sigstore integration time:
-
Permalink:
marcinpsk/netbox-InterfaceNameRules-plugin@a066fb5b1b223e4df10d2e25811918e74c7c84e4 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/marcinpsk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yaml@a066fb5b1b223e4df10d2e25811918e74c7c84e4 -
Trigger Event:
push
-
Statement type: