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

IOS get_bgp_neighbors same IP different VRF - Fix #1497 #1231 #1751

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions napalm/ios/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -1957,12 +1957,17 @@ def get_bgp_neighbors(self):
# get neighbor_entry out of neighbor data
neighbor_entry = None
for neighbor in neighbor_data:
if (
neighbor["afi"].lower() == afi
and napalm.base.helpers.ip(neighbor["remote_addr"]) == remote_addr
):
neighbor_entry = neighbor
break
current_neighbor = napalm.base.helpers.ip(neighbor["remote_addr"])
if neighbor["afi"].lower() == afi and current_neighbor == remote_addr:
# Neighbor IPs in VRFs can overlap, so make sure
# we haven't covered this VRF + IP already
vrf = neighbor["vrf"] or "global"
if (
vrf == "global"
or current_neighbor not in bgp_neighbor_data[vrf]["peers"]
):
neighbor_entry = neighbor
break
# check for proper session data for the afi
if neighbor_entry is None:
continue
Expand Down
Loading