Skip to main content

NetBox plugin for automatic interface renaming when modules are installed

Project description

NetBox Interface Name Rules Plugin

PyPI PyPI - Downloads CI Coverage License Python NetBox 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

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

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

netbox_interface_name_rules-1.2.1.tar.gz (56.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netbox_interface_name_rules-1.2.1-py3-none-any.whl (74.8 kB view details)

Uploaded Python 3

File details

Details for the file netbox_interface_name_rules-1.2.1.tar.gz.

File metadata

File hashes

Hashes for netbox_interface_name_rules-1.2.1.tar.gz
Algorithm Hash digest
SHA256 3bd7a5e65819e70e706c506fe8e1361191ebd7b44bc3252f36db42df47a879b7
MD5 dbaac78aa3af83593b1c52e0789ec764
BLAKE2b-256 645e52427dc089d69a033c49536e17bb8b5906fff5646f52be4a8a5c716de8ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_interface_name_rules-1.2.1.tar.gz:

Publisher: publish-pypi.yaml on marcinpsk/netbox-InterfaceNameRules-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netbox_interface_name_rules-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_interface_name_rules-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7452ec22301df5d091dc098e43512fdb74e0cb3251902ce444d9861726506cc9
MD5 c43470ba878de14da90d19bf710fb9ce
BLAKE2b-256 e2176275a7a6806b0db9de39bd7dcbffabad76504634c5ffc867fccb28053ad9

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_interface_name_rules-1.2.1-py3-none-any.whl:

Publisher: publish-pypi.yaml on marcinpsk/netbox-InterfaceNameRules-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page