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() fails when there are Peers with same IP on different VRFs, works fine if they are unique. #1497

Closed
sohanrai09 opened this issue Sep 16, 2021 · 1 comment

Comments

@sohanrai09
Copy link

sohanrai09 commented Sep 16, 2021

Description of Issue/Question

Note: Please check https://guides.github.com/features/mastering-markdown/
to see how to properly format your request.

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

(Place an x between the square brackets where applicable)

  • [x] Yes
  • [] No

Setup

napalm version

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

napalm==3.3.1

Network operating system version

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

IOSv Software (VIOS-ADVENTERPRISEK9-M), Version 15.6(2)T, RELEASE SOFTWARE (fc2)

Steps to Reproduce the Issue

get_bgp_neighbors() fails when there are Peers with same IP on different VRFs, works fine if they are unique

Config :
R-2#sh run | s r b
router bgp 200
bgp log-neighbor-changes
neighbor 12.12.12.1 remote-as 100
!
address-family vpnv4
exit-address-family
!
address-family ipv4 vrf VRF-1
neighbor 20.20.20.1 remote-as 100
neighbor 20.20.20.1 timers 10 30
neighbor 20.20.20.1 activate
neighbor 30.30.30.1 remote-as 100
neighbor 30.30.30.1 timers 10 30
neighbor 30.30.30.1 activate
exit-address-family
!
address-family ipv4 vrf VRF-2
neighbor 20.20.20.1 remote-as 100
neighbor 20.20.20.1 timers 10 30
neighbor 20.20.20.1 activate
exit-address-family
R-2#

CLI BGP O/P (shortened):
R-2#sh ip bgp all summ
For address family: IPv4 Unicast
==omitted==

        Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
        12.12.12.1      4        100      48      50        2    0    0 00:07:25        1
        
        For address family: VPNv4 Unicast
        ==omitted==
        
        Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
        20.20.20.1      4        100       0       0        1    0    0 never    Idle
        20.20.20.1      4        100      49      51        3    0    0 00:07:22        1
        30.30.30.1      4        100      50      51        3    0    0 00:07:23        1
        R-2#

Error Traceback

(Paste the complete traceback of the exception between quotes below)

Traceback (most recent call last):
  File "c:\Users\User\Documents\Python\test2.py", line 10, in <module>
    BGP = device.get_bgp_neighbors()
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\napalm\ios\ios.py", line 1903, in get_bgp_neighbors
    assert afi not in existing["address_family"]
AssertionError
@jtishey
Copy link
Contributor

jtishey commented Sep 13, 2022

Submitted PR #1751 for review to fix this.

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

3 participants