netbox-community / netbox-bgp

NetBox plugin for BGP related objects documentation
Apache License 2.0
245 stars 49 forks source link

Feature Request: IBGP Representation #18

Open liquid-metal opened 3 years ago

liquid-metal commented 3 years ago

It would be really helpful to create a BGP session between two devices.

Currently, one can assign the same ASN to remote and local to create an IBGP connection, though this is sub-optimal, as the BGP connection only shows up on the device it is assigned to, and not on the other one.

I propose a distiction in the session creation interface between "Remote AS (EBGP)" and "IBGP". EBGP is the functionality as it is now, but IBGP lets you select a device and an IP address associated with an interface of that device.

liquid-metal commented 3 years ago

I'd imagine something like this: 2021-05-18_12 01 34_screenshot 2021-05-18_12 01 40_screenshot

Remote Address and iBGP IP Address would be stored in the same DB field, iBGP device would be a new field. @k01ek what do you think about this approach?

In Addition, this would mean that the list of BGP Sessions of a device would be generated by filtering on the device and ibgp_device fields, so the same session will be shown on the two different devices

Currently I am unsure about uniqueness of the BGPSession objects, what fields to include

k01ek commented 3 years ago

Hi @liquid-metal and thanks for your work! We need to discuss an approach for iBGP session representation. In my opinion, the BGP session should be considered from a device point of view. So for iBGP should be created two sessions for both devices, because, you know, local address and remote address are different for each device. Another question is how to display iBGP sessions. Maybe they should be grouped in tables, or displayed only one of them (both sessions contain a link to another end). Also, a remote device field is needed for the iBGP session in a table. Anyway, I like your form for eBGP/iBGP session and I will try it soon.

ryanmerolle commented 2 years ago

I am not sure editing the UI for add/updating sessions would be needed since the difference between eBGP and iBGP is the remote & local ASNs. You do not go into a config of a device and declare it as iBGP or eBGP.

I feel like its just the way you display the info in tables after the fact, and not the way in which you enter the info.

mkurjanski commented 1 year ago

I agree with the approach to leave the BGP sessions as they are right now. If the local and remote ASN is the same that's the easy way to determine it's an iBGP session.

balpoint commented 1 year ago

Just weighing in on this because i too am looking for a good way to model iBGP session, i'm using all of netbox including the bgp plugin as a source-of-truth so i want to use the bgp session model as a data source for templating actual config.

I'm currently running into this discussion from a automating p.o.v.

Wouldn't it be a easy fix and implementation to make a "Device A (local)" and "Device B (remote)" field that is device.object linked just as the current "Device" field is.

I.m.o this would literally be a copy and renaming of the existing "Device" field.

This small addition would provide, from an automation standpoint a easy way to lookup the local and remote device and flip the data in bgp local/remote address in the config templating per device based on 1 bgp session query

Now i have to check the local and remote ip, get that ip object, check which device the ip is living on and based on that information define on which device i need to use the local or remote address as a neighbor ip.

carbinefreak commented 1 year ago

Another iBGP topic is cluster id's for route reflectors, we really should have that defined somewhere and it is normally tied to the BGP group.