https://github.com/marcinpsk/netbox-interfacenamerules-plugin
Automatic interface renaming when modules are installed into NetBox device bays.
https://github.com/marcinpsk/netbox-interfacenamerules-plugin
netbox netbox-automation netbox-plugin
Last synced: 12 days ago
JSON representation
Automatic interface renaming when modules are installed into NetBox device bays.
- Host: GitHub
- URL: https://github.com/marcinpsk/netbox-interfacenamerules-plugin
- Owner: marcinpsk
- License: apache-2.0
- Created: 2026-02-19T22:03:56.000Z (21 days ago)
- Default Branch: main
- Last Pushed: 2026-02-26T23:07:01.000Z (14 days ago)
- Last Synced: 2026-02-27T04:46:15.434Z (14 days ago)
- Topics: netbox, netbox-automation, netbox-plugin
- Language: Python
- Homepage:
- Size: 5.37 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NetBox Interface Name Rules Plugin
[](https://pypi.org/project/netbox-interface-name-rules/)
[](https://pypi.org/project/netbox-interface-name-rules/)
[](https://github.com/marcinpsk/netbox-InterfaceNameRules-plugin/actions/workflows/test.yaml)
[](https://marcinpsk.github.io/netbox-InterfaceNameRules-plugin/coverage/)
[](LICENSE)
[](https://pypi.org/project/netbox-interface-name-rules/)
[](https://github.com/netbox-community/netbox)
[](https://github.com/marcinpsk/netbox-InterfaceNameRules-plugin/graphs/contributors)
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
```bash
pip install netbox-interface-name-rules
```
Add to `configuration.py`:
```python
PLUGINS = ['netbox_interface_name_rules']
```
## Compatibility
- NetBox ≥ 4.2.0
- Python ≥ 3.12
## License
Apache 2.0
## Documentation
- [Full documentation](https://marcinpsk.github.io/netbox-InterfaceNameRules-plugin/) — installation, configuration, examples
- [DeepWiki](https://deepwiki.com/marcinpsk/netbox-InterfaceNameRules-plugin) — AI-generated codebase overview
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for how to submit code or interface name rules.
Community-contributed rules for various vendors are in the [`contrib/`](contrib/) directory.