Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions netsim/extra/ebgp.multihop/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def pre_link_transform(topology: Box) -> None:
if 'vrf' in intf:
intf.bgp._vrf = intf.vrf
intf._bgp_session = True
intf._phantom_link = True
intf.ifname = f'_ebgp_multihop_{s.linkindex}'

topology.links.extend(sessions)
Expand Down
2 changes: 2 additions & 0 deletions netsim/modules/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,8 @@ def resolve_node_nexthop(sr_data: Box, node: Box, topology: Box) -> Box:

node_found = False
for intf in node.interfaces:
if intf.get('_phantom_link',False):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not simply check for _bgp_session here? It implies "phantom_link"

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... because I'd like to have a generic mechanism we might need in the future (one of these days we'll tackle TE, and the TE tunnels might be another case of phantom links).

continue
for ngb in intf.neighbors:
if ngb.node != sr_data.nexthop.node:
continue
Expand Down
2 changes: 2 additions & 0 deletions tests/topology/expected/ebgp.utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ bgp:
password: Funny
interfaces:
- _bgp_session: true
_phantom_link: true
bgp:
local_as: 123
multihop: 255
Expand All @@ -21,6 +22,7 @@ bgp:
ipv4: 10.0.0.2/32
node: r2
- _bgp_session: true
_phantom_link: true
bgp:
local_as: 456
multihop: 255
Expand Down