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, 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"]

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.6, plus NetBox main as a non-blocking early warning)
  • 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 tests (shared test_netbox DB)
netbox-test-isolated <app> [flags]   # run on a per-session ISOLATED test DB

netbox-test-isolated is concurrency-safe: Django otherwise names the test database test_<DB_NAME> (test_netbox), so two manage.py test runs in the same devcontainer collide on one DB and corrupt each other's migrations (a crashed run can even leave an idle in transaction connection holding locks that wedges every later run). The helper points the test DB at a unique name — derived from the first app argument, or TEST_DB_NAME=... — via the isolated_test_settings shim (--settings=isolated_test_settings with .devcontainer/config on PYTHONPATH). Plain netbox-test keeps using the shared default (test_netbox); netbox-test-isolated instead derives a per-app DB name by default — test_<app> from the first app argument (this plugin when none is given) — unless you set TEST_DB_NAME explicitly. Example — test a sibling plugin without disturbing a parallel run:

netbox-test-isolated netbox_nso_plugin --keepdb

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.5.1.tar.gz (176.6 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.5.1-py3-none-any.whl (205.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for netbox_interface_name_rules-1.5.1.tar.gz
Algorithm Hash digest
SHA256 b22f7432bb79599d0358a3b353c6f18c85b6235b57b472ea5ad429fb8846795a
MD5 a66580cff480a39b253cbd3cf31920e0
BLAKE2b-256 5b96864b9c42a2b9ed4e8d3d8baa2d7d1a09347691b02a2fed65ef52607f1379

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_interface_name_rules-1.5.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.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_interface_name_rules-1.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b2e41c6c96dd2ef3fd8f68d80ab4e010bdc22aba8e5986f7355f5e33020411a7
MD5 b9d29f65bfb6bdc1f9f9a70a5da70ae7
BLAKE2b-256 fa0ed75ec0eb278ed85f6c0d4fcf2dacca4b4fc9a03afe14193fa22b3c290a8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_interface_name_rules-1.5.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.

Release history Release notifications | RSS feed

1.5.2

2 files

This release

1.5.1 This release

2 files

1.5.0

2 files

1.4.3

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.2

2 files

1.1.0

2 files

1.0.0

2 files

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