netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.07k stars 2.58k forks source link

Assign ASN's to device(s) for use in a BGP/VXLAN/EVPN network. #10425

Closed ThomasADavis closed 2 years ago

ThomasADavis commented 2 years ago

NetBox version

v3.3.4

Feature type

Data model extension

Proposed functionality

Add ability to assign ASN's to device(s), not just sites for use in VXLAN/EVPN network.

Use case

In modeling VXLAN/EVPN tunnels/networks, a unique ASN is assigned to every device running BGP/VXLAN/EVPN tunnels. This assignment currently can't be done on a device basis, only to a site. Please note, for the spines you may have two or more devices with the same ASN assigned.

I have used a custom field to deal with this, but the ASN does not show up with the device.

When looking at a device, a possible location for the ASN to show up would in the Management field, just like a Primary IPv4/IPv6 address.

Database changes

Addition of device(s) object reference to the ASN object.

External dependencies

None that I know of.

jsenecal commented 2 years ago

This is a per-implementation detail and can be represented with a custom field like you did, and you can fix the tables to display the custom field.

For instance, MAC VRFs (Juniper and others) allows multiple ASNs per device for EVPN scenarios...

I don't think this brings anything else to the table to be honest.

ThomasADavis commented 2 years ago

Hmm.. so, what your saying is a common use case (VXLAN/EVPN), netbox can't be used to model it unless custom fields are used, that can't be cross linked between objects? ie, you can't tell the custom field value to show up in both the ASN and the device object; you can assign a the custom field to both objects, but if you fill it out in ASN's, it doesn't show up in the device fields.. so I'm stucking doing is adding two custom fields, one linking the ASN to the device, and one linking the device to ASN..

And when you say 'fix the tables', what tables are talking about?

jsenecal commented 2 years ago

@ThomasADavis Perhaps your use case was not properly demonstrated.

Let me explain. Your PER DEVICE requirement for an ASN is tied to your own way of doing things and doesn't apply to everyone. I cited an example with MAC VRFs scenarios.

What you are asking is to have a Many to Many relationship between ASNs and Devices/VirtualMachines. Where both have references to each other, correct ? This requires significant changes to the models, database schema and APIs.

When using Custom Fields, you say that the "ASN does not show up with the device". In which view ? Can you screenshot what you mean ?

By fixing the tables I meant clicking on the "Configure Table" button at the top right corner of the table which lists the Devices to add your custom field in the table columns.

Let us know,

jeremystretch commented 2 years ago

There's already a good amount of discussion around this idea on #8782. Please add any further comments to that issue; I'm going to close this one out as a duplicate to avoid fracturing the conversation. Thanks!