Automated Interface Renaming Based on Virtual Chassis Member Position #189

Closed
opened 2026-04-05 16:22:46 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @greatmerlin on 3/9/2026

NetBox version

v4.5.2-Docker-4.0.0

Feature type

Change to existing functionality

Proposed functionality

I propose enhancing the Virtual Chassis (VC) logic to allow for dynamic, pattern-based interface renaming when a Device is assigned a position (Member ID) within a Virtual Chassis.

Currently, NetBox treats interface names as static strings. When a device is added to a VC and assigned a position (e.g., Position 2), the user must manually rename every interface (e.g., from GigabitEthernet1/0/1 to GigabitEthernet2/0/1). This proposal automates that shift.

Technical Implementation Details:

  • Template Pattern Support: Enhance InterfaceTemplate to support placeholders. For example, a template could define a name as GigabitEthernet{module}/0/{index}.

  • VC Joining Logic: When a Device is associated with a Virtual Chassis and assigned a position, NetBox should trigger a logic layer that checks for these patterns.

  • UI Implementation: Add a toggle/checkbox in the "Add to Virtual Chassis" and "Edit Virtual Chassis Member" views labeled: "Update interface names to match stack position."

  • Bulk Rename Logic: If the toggle is enabled, NetBox will iterate through existing interfaces and update the {module} or prefix segment of the string to match the assigned position integer.

Use case

In enterprise networking (e.g., Cisco Catalyst, Juniper Virtual Chassis), stackable switches follow a Member/Slot/Port convention. When a switch is re-indexed from member 1 to member 2, its logical identity changes across all physical ports.

Automating this in NetBox eliminates massive manual overhead. For instance, in an 8-switch stack of 48-port switches, a user currently has to manually edit 384+ interfaces. This feature prevents data entry errors and significantly speeds up the "Staging" phase of network deployments.

Database changes

No immediate schema changes are required if the logic is handled at the application level during the "Join VC" process.

However, to make this robust long-term, adding a name_pattern field (String) to the InterfaceTemplate model would allow NetBox to know exactly which part of the interface name is intended to be dynamic versus static.

External dependencies

None. This functionality relies on existing internal NetBox models (VirtualChassis, Device, Interface).

*Originally created by @greatmerlin on 3/9/2026* ### NetBox version v4.5.2-Docker-4.0.0 ### Feature type Change to existing functionality ### Proposed functionality I propose enhancing the Virtual Chassis (VC) logic to allow for dynamic, pattern-based interface renaming when a Device is assigned a position (Member ID) within a Virtual Chassis. Currently, NetBox treats interface names as static strings. When a device is added to a VC and assigned a position (e.g., Position 2), the user must manually rename every interface (e.g., from GigabitEthernet1/0/1 to GigabitEthernet2/0/1). This proposal automates that shift. Technical Implementation Details: - Template Pattern Support: Enhance InterfaceTemplate to support placeholders. For example, a template could define a name as GigabitEthernet{module}/0/{index}. - VC Joining Logic: When a Device is associated with a Virtual Chassis and assigned a position, NetBox should trigger a logic layer that checks for these patterns. - UI Implementation: Add a toggle/checkbox in the "Add to Virtual Chassis" and "Edit Virtual Chassis Member" views labeled: "Update interface names to match stack position." - Bulk Rename Logic: If the toggle is enabled, NetBox will iterate through existing interfaces and update the {module} or prefix segment of the string to match the assigned position integer. ### Use case In enterprise networking (e.g., Cisco Catalyst, Juniper Virtual Chassis), stackable switches follow a Member/Slot/Port convention. When a switch is re-indexed from member 1 to member 2, its logical identity changes across all physical ports. Automating this in NetBox eliminates massive manual overhead. For instance, in an 8-switch stack of 48-port switches, a user currently has to manually edit 384+ interfaces. This feature prevents data entry errors and significantly speeds up the "Staging" phase of network deployments. ### Database changes No immediate schema changes are required if the logic is handled at the application level during the "Join VC" process. However, to make this robust long-term, adding a name_pattern field (String) to the InterfaceTemplate model would allow NetBox to know exactly which part of the interface name is intended to be dynamic versus static. ### External dependencies None. This functionality relies on existing internal NetBox models (VirtualChassis, Device, Interface).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#189