Support for Interface Aliases (Alternative Names) on VM and Device Interfaces #10981

Open
opened 2025-12-29 21:38:46 +01:00 by adam · 4 comments
Owner

Originally created by @ITJamie on GitHub (Apr 4, 2025).

NetBox version

v4.2.6

Feature type

Data model extension

Proposed functionality

Introduce support for defining one or more alternative names (aliases) on both virtual machine interfaces and physical device interfaces. These aliases would reflect how a single interface may be identified differently across contexts—for example, in virtual environments, operating systems, monitoring tools, or provisioning systems.

it should be possible to add or remove multiple alias names per interface

Proposed changes:
• Add a new optional field to both Interface and VMInterface models:
• aliases (JSONField or ArrayField depending on database backend)

Update the UI to:
• Allow users to view and edit aliases on the interface form
• Optionally show aliases in interface list/detail views
Update the REST API to:
• Include the aliases field in interface serializers
• Support filtering by alias (if feasible)

Use case

Interfaces are often known by different names depending on the system or tool involved:
• Virtual machines: net0 (host/qemu) vs. ens18 (guest OS)
• Linux systems: ens18 with altname enp0s18
• SNMP vs. config management tools vs. provisioning systems

Database changes

Add a new optional aliases field to the Interface and VMInterface models:
• Type: JSONField
• use: to hold an Array of strings (e.g. ["ens18", "net0", "enp0s18"])

External dependencies

No response

slack thread

https://netdev-community.slack.com/archives/C01P0FRSXRV/p1743703568159339

Originally created by @ITJamie on GitHub (Apr 4, 2025). ### NetBox version v4.2.6 ### Feature type Data model extension ### Proposed functionality Introduce support for defining one or more alternative names (aliases) on both virtual machine interfaces and physical device interfaces. These aliases would reflect how a single interface may be identified differently across contexts—for example, in virtual environments, operating systems, monitoring tools, or provisioning systems. it should be possible to add or remove multiple alias names per interface Proposed changes: • Add a new optional field to both Interface and VMInterface models: • aliases (JSONField or ArrayField depending on database backend) Update the UI to: • Allow users to view and edit aliases on the interface form • Optionally show aliases in interface list/detail views Update the REST API to: • Include the aliases field in interface serializers • Support filtering by alias (if feasible) ### Use case Interfaces are often known by different names depending on the system or tool involved: • Virtual machines: net0 (host/qemu) vs. ens18 (guest OS) • Linux systems: ens18 with altname enp0s18 • SNMP vs. config management tools vs. provisioning systems ### Database changes Add a new optional aliases field to the Interface and VMInterface models: • Type: JSONField • use: to hold an Array of strings (e.g. ["ens18", "net0", "enp0s18"]) ### External dependencies _No response_ ### slack thread https://netdev-community.slack.com/archives/C01P0FRSXRV/p1743703568159339
Author
Owner

@bctiemann commented on GitHub (Apr 7, 2025):

@ITJamie This sounds like an alternative to tagging, but only restricted to interfaces.

  1. Couldn't this be done with tagging?
  2. If implemented, shouldn't this be extended to all models?
  3. One of the reasons I mention tagging is performance considerations. Filtering by tag is performant, but filtering on a JSONField may be less so.
@bctiemann commented on GitHub (Apr 7, 2025): @ITJamie This sounds like an alternative to tagging, but only restricted to interfaces. 1. Couldn't this be done with tagging? 2. If implemented, shouldn't this be extended to all models? 3. One of the reasons I mention tagging is performance considerations. Filtering by tag is performant, but filtering on a JSONField may be less so.
Author
Owner

@ITJamie commented on GitHub (Apr 7, 2025):

This has nothing to do with tagging?

Its the fact that interface names can be different depending on the viewpoint. Eg on a linux vm eth0 might have an altname of ens18 or similar.

Similarly that same interface might be known to the hypevisor as a different name (eg net0 in proxmox land)

Its the same logical interface but documenting that it can have alternative names

@ITJamie commented on GitHub (Apr 7, 2025): This has nothing to do with tagging? Its the fact that interface names can be different depending on the viewpoint. Eg on a linux vm eth0 might have an altname of ens18 or similar. Similarly that same interface might be known to the hypevisor as a different name (eg net0 in proxmox land) Its the same logical interface but documenting that it can have alternative names
Author
Owner

@bctiemann commented on GitHub (Apr 7, 2025):

Oh I see. Didn't realize this referred to OS-level device aliases, as opposed to aliases for organizing items in NetBox.

@bctiemann commented on GitHub (Apr 7, 2025): Oh I see. Didn't realize this referred to OS-level device aliases, as opposed to aliases for organizing items in NetBox.
Author
Owner

@PieterL75 commented on GitHub (Sep 24, 2025):

Isn't a custom field suited for this?

@PieterL75 commented on GitHub (Sep 24, 2025): Isn't a custom field suited for this?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10981