Cross-reference BGP ASN and Devices #10317

Closed
opened 2025-12-29 21:29:51 +01:00 by adam · 8 comments
Owner

Originally created by @dmulyalin on GitHub (Oct 3, 2024).

NetBox version

v4.1.3

Feature type

Data model extension

Proposed functionality

BGP ASN rarely exist on its own and in most of the cases assigned to or used by devices, Netbox as of now does not have capability to capture what devices use what ASNs without relying on custom fields, adding multiref field to device to link ASNs it is using can help to improve Netbox ASN documentation capabilities.

Use case

Devices use ASN but currently Netbox does not have built in way to establish relationship between BGP ASN and devices apart from using custom fields, this use case is to introduce such a relationship and help network operators document what ASNs used by what devices.

Database changes

Device model need to be extended with asns many-to-many field with relevant UI additions.

External dependencies

None

Originally created by @dmulyalin on GitHub (Oct 3, 2024). ### NetBox version v4.1.3 ### Feature type Data model extension ### Proposed functionality BGP ASN rarely exist on its own and in most of the cases assigned to or used by devices, Netbox as of now does not have capability to capture what devices use what ASNs without relying on custom fields, adding multiref field to device to link ASNs it is using can help to improve Netbox ASN documentation capabilities. ### Use case Devices use ASN but currently Netbox does not have built in way to establish relationship between BGP ASN and devices apart from using custom fields, this use case is to introduce such a relationship and help network operators document what ASNs used by what devices. ### Database changes Device model need to be extended with ``asns`` many-to-many field with relevant UI additions. ### External dependencies None
adam added the type: featurenetbox labels 2025-12-29 21:29:51 +01:00
adam closed this issue 2025-12-29 21:29:51 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 3, 2024):

What specifically are you proposing? Assigning an ASN directly to a device would not suffice for moderately complex routing policies which advertise different AS numbers to different peers. IMO this falls entirely within the scope of BGP routing policy.

@jeremystretch commented on GitHub (Oct 3, 2024): What specifically are you proposing? Assigning an ASN directly to a device would not suffice for moderately complex routing policies which advertise different AS numbers to different peers. IMO this falls entirely within the scope of BGP routing policy.
Author
Owner

@dmulyalin commented on GitHub (Oct 3, 2024):

I am proposing to link devices with ASNs similar to how we link device interfaces with VLANs, since ASNs used by devices and it is important to capture what devices use what ASN for various use cases - configuration rendering, network audit, troubleshooting to name a few.

@dmulyalin commented on GitHub (Oct 3, 2024): I am proposing to link devices with ASNs similar to how we link device interfaces with VLANs, since ASNs used by devices and it is important to capture what devices use what ASN for various use cases - configuration rendering, network audit, troubleshooting to name a few.
Author
Owner

@cruse1977 commented on GitHub (Oct 8, 2024):

Is this not possible using netbox-bgp already ?

@cruse1977 commented on GitHub (Oct 8, 2024): Is this not possible using netbox-bgp already ?
Author
Owner

@Omripresent commented on GitHub (Oct 14, 2024):

ASN assignments wouldn't specifically be a device only construct, in some cases it'll be assigned by VRF, in others to a virtual machine.

In https://github.com/DanSheps/netbox-routing plugin the model BGPRouter is meant to bridge that gap, but as it's not fully implemented yet I can't recommend it.

Netbox-BGP doesn't have that functionality, the ASN is associated to a given session and could vary across implementations.

I think the netbox-routing plugin implementation is the right way to go once BGP is implemented.

@Omripresent commented on GitHub (Oct 14, 2024): ASN assignments wouldn't specifically be a device only construct, in some cases it'll be assigned by VRF, in others to a virtual machine. In https://github.com/DanSheps/netbox-routing plugin the model BGPRouter is meant to bridge that gap, but as it's not fully implemented yet I can't recommend it. Netbox-BGP doesn't have that functionality, the ASN is associated to a given session and could vary across implementations. I think the netbox-routing plugin implementation is the right way to go once BGP is implemented.
Author
Owner

@dmulyalin commented on GitHub (Oct 16, 2024):

To me ASN is no different to Vlan or IP address - neither of them exist on its own and always assigned to something, in most of the cases they assigned to and used by devices, physical or virtual, (to me) it is strange to not see built-in capability to link/assign ASN to anything but the site. I would expect I am not the only one who finds a need for such a functionality.

There are many ways to address it though - use custom fields, use custom plugins, it will work, but at the end of the day if many users do these customizations, maybe it is something worth to consider building into Netbox core itself.

I am of course by no means can speak for other users, but thought at least it would be good to raise this to get a feedback.

@dmulyalin commented on GitHub (Oct 16, 2024): To me ASN is no different to Vlan or IP address - neither of them exist on its own and always assigned to something, in most of the cases they assigned to and used by devices, physical or virtual, (to me) it is strange to not see built-in capability to link/assign ASN to anything but the site. I would expect I am not the only one who finds a need for such a functionality. There are many ways to address it though - use custom fields, use custom plugins, it will work, but at the end of the day if many users do these customizations, maybe it is something worth to consider building into Netbox core itself. I am of course by no means can speak for other users, but thought at least it would be good to raise this to get a feedback.
Author
Owner

@nickper commented on GitHub (Oct 18, 2024):

I can see the need for this.
We currently only have 1 public ASN, but run different private ASN's on our Pods. A good way to register this is linking the ASN to the device.

one problem with this approach is that switches and servers often don't have ASNs assigned to them, and therefor have extra bloatware in there view because of this.

@nickper commented on GitHub (Oct 18, 2024): I can see the need for this. We currently only have 1 public ASN, but run different private ASN's on our Pods. A good way to register this is linking the ASN to the device. one problem with this approach is that switches and servers often don't have ASNs assigned to them, and therefor have extra bloatware in there view because of this.
Author
Owner

@jeremystretch commented on GitHub (Oct 22, 2024):

Device model need to be extended with asns many-to-many field with relevant UI additions.

This was proposed in #8782, and was ultimately rejected because it is insufficient to support complex routing policy. However, I can see the value of a singular ForeignKey assignment of a device to a specific ASN indicating its "native" AS. This still does not address routing policy but it allows for the fundamental association of a device to an ASN.

@jeremystretch commented on GitHub (Oct 22, 2024): > Device model need to be extended with asns many-to-many field with relevant UI additions. This was proposed in #8782, and was ultimately rejected because it is insufficient to support complex routing policy. However, I can see the value of a singular ForeignKey assignment of a device to a specific ASN indicating its "native" AS. This still does not address routing policy but it allows for the fundamental association of a device to an ASN.
Author
Owner

@dmulyalin commented on GitHub (Oct 26, 2024):

It does not give much value to reference device with single ASN only, in fact it will make things more cumbersome for those folks who configure devices to participate in multiple ASN, if this is the only direction you considering, think it is better to leave things where they are right now.

@dmulyalin commented on GitHub (Oct 26, 2024): It does not give much value to reference device with single ASN only, in fact it will make things more cumbersome for those folks who configure devices to participate in multiple ASN, if this is the only direction you considering, think it is better to leave things where they are right now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10317