Skip to main content

NetBox Interface Name Rules Plugin

PyPI PyPI - Downloads CI Coverage License Python NetBox Contributors REUSE status

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, after a module moves, and after the position of an occupied module bay changes. A bay name change also triggers them when a template variable reads the name. No manual step is needed
  • Template variables: {slot}, {bay_position}, {bay_position_num}, {base}, {channel}, etc.
  • Arithmetic expressions: {8 + ({parent_bay_position_num} - 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, platforms (with their child platforms on NetBox 4.4+), or be universal
  • Bulk import/export: YAML-based rule management via the UI or API
  • netbox-branching: renames run in the active branch, and a merge, revert or sync keeps the names that it replays (netbox-branching 1.2.x on NetBox 4.7). A channel that the plugin kept at its old name is the exception: see Limits in a branch

Supported scenarios

Scenario Name template Example result
Converter offset GigabitEthernet{slot_num}/{8 + ({parent_bay_position_num} - 1) * 2 + {sfp_slot}} GLC-T in CVR-X2-SFP → GigabitEthernet3/10
Breakout channels et-0/0/{bay_position}:{channel} QSFP-4X10G-LR → et-0/0/4:0 through et-0/0/4:3
Platform naming et-0/0/{bay_position} QSFP-100G-LR4 on ACX7024 → et-0/0/4
UfiSpace breakout swp{bay_position_num}s{channel} QSFP-100G on S9610 → swp1s0 through swp1s3

Installation

pip install netbox-interface-name-rules

Add to configuration.py:

PLUGINS = ["netbox_interface_name_rules"]

Configuration

Rules are managed through the NetBox UI under Plugins → Interface Name Rules, or via the REST API at /api/plugins/interface-name-rules/rules/.

See the full configuration guide for all rule fields, priority scoring, and template variable reference.

Screenshots

NetBox Interface Name Rules

Rule list

Apply-rules preview

Compatibility

  • NetBox ≥ 4.3.0 (CI tests 4.3, 4.5, 4.7, plus NetBox main and feature as non-blocking early warnings)
  • 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.

Testing

Inside the devcontainer:

netbox-test                          # run this plugin's suite with pytest
netbox-test <pytest args>            # e.g. one file, or -k 'a test name'

netbox-test runs pytest, the runner CI uses, so the fixtures and guards in conftest.py apply. It uses the test_netbox_interface_name_rules database and gives each xdist worker its own copy. Concurrent netbox-test calls wait for each other. Set TEST_DB_NAME=... or TEST_REDIS_HOST=... to use other targets.

netbox-test-isolated <app> [flags] runs the Django test runner (manage.py test) on an isolated database. Do not use it for this plugin's suite: it skips conftest.py. It exists for the performance runner and for other apps. Django otherwise names the test database test_<DB_NAME> (test_netbox), so two concurrent runs share one database and corrupt each other's migrations. The helper sets the database name to test_<app> from the first app argument, or to TEST_DB_NAME=..., through the isolated_test_settings shim:

netbox-test-isolated <other_app> --keepdb

Metadata

Release files for netbox-interface-name-rules 1.10.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netbox-interface-name-rules 1.10.2
File Size Uploaded Provenance Actions
netbox_interface_name_rules-1.10.2.tar.gz 476.7 kB With provenance Details for netbox_interface_name_rules-1.10.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for netbox-interface-name-rules 1.10.2
File Interpreter ABI Platform Actions
netbox_interface_name_rules-1.10.2-py3-none-any.whl Python 3 none any Details for netbox_interface_name_rules-1.10.2-py3-none-any.whl

Total release size: 1.0 MB

Release files / netbox_interface_name_rules-1.10.2.tar.gz

Download URL netbox_interface_name_rules-1.10.2.tar.gz
Size 476.7 kB
Tags Source
SHA-256 checksum
How to use checksums
38b751db6ee4584c765db99f029a5991136e961bfa60907c8d98ef431d85341c
BLAKE2b-256 checksum
How to use checksums
6e0f118f1b0584988be7d6639668ac6fe03fee54cc7988ec6e12030009c7f93f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / netbox_interface_name_rules-1.10.2-py3-none-any.whl

Download URL netbox_interface_name_rules-1.10.2-py3-none-any.whl
Size 552.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f73243588dc4c9e9334f25133b1f51a26e4a27e8330e5a3f0a567f4c1fdc8102
BLAKE2b-256 checksum
How to use checksums
6df20b5cbc7ef464e07bc51a6c75890dd15e67ecdade12d9764f26dfc7c73c60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for netbox-interface-name-rules 1.10.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for netbox_interface_name_rules-1.10.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page