Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_bgp_neighbors returns incorrect local-as for NXOS #1964

Open
1 task done
mkurjanski opened this issue Jun 14, 2023 · 1 comment
Open
1 task done

get_bgp_neighbors returns incorrect local-as for NXOS #1964

mkurjanski opened this issue Jun 14, 2023 · 1 comment

Comments

@mkurjanski
Copy link

mkurjanski commented Jun 14, 2023

Description of Issue/Question

get_bgp_neighbors for NXOS returns global local-as setting rather than the per-session local-as

Looking at the internals of napalm it uses 'show bgp all summary vrf all' in the NXOS driver for gt_bgp_neighbors.
This command only returns the global ASN for the BGP router. It does not return the actual local-as for each BGP peering session. You'd need to combine the data from 'show running-config bgp' output in order to return the correct local-as for each individual BGP session.

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

(Place an x between the square brackets where applicable)

  • Yes
  • [] No

Setup

napalm version

(Paste verbatim output from pip freeze | grep napalm between quotes below)

$ pip freeze | grep napalm
napalm==3.4.1
napalm-ansible==1.1.0
napalm-base==1.0.1

Network operating system version

(Paste verbatim output from show version - or equivalent - between quotes below)

Software
 BIOS: version 5.6.0
 NXOS: version 9.3(10)

Steps to Reproduce the Issue

lab-nxos# show bgp all summary vrf all
BGP summary information for VRF default, address family IPv4 Unicast
BGP router identifier 172.26.156.34, local AS number 65115.7000
BGP table version is 499, IPv4 Unicast config peers 2, capable peers 1
3 network entries and 3 paths using 732 bytes of memory
BGP attribute entries [2/344], BGP AS path entries [1/10]
BGP community entries [1/36], BGP clusterlist entries [0/0]

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
11.11.11.1      4 65001    2932    2889      499    0    0 00:48:42 2 

lab-nxos# sh run bgp 

!Command: show running-config bgp
!Running configuration last done at: Tue Jun 13 16:50:39 2023
!Time: Wed Jun 14 09:25:54 2023

version 9.3(10) Bios:version 5.6.0 
feature bgp

router bgp 65115.7000
  router-id <redacted>
  address-family ipv4 unicast
  neighbor 11.11.11.1
    remote-as 65001
    local-as 12345
    description test_descr
    address-family ipv4 unicast

@mkurjanski
Copy link
Author

mkurjanski commented Jun 14, 2023

Actually I just noticed that 'show ip bgp neighbors vrf all' returns local AS for eBGP neighbors so it could be used for more accurate information.

# show ip bgp neighbors vrf all
BGP neighbor is 11.11.11.1, remote AS 65001, local AS 12345, ebgp link, Peer index 5
  Description: test_descr
  BGP version 4, remote router ID 1.1.1.2
  Neighbor previous state = OpenConfirm
  BGP state = Established, up for 02:54:10
  Neighbor vrf: default
  ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants