Skip to content

Commit

Permalink
Merge pull request #1347 from malanovo/route-to-vxlan
Browse files Browse the repository at this point in the history
Set next hop to something valid for vxlan routes
  • Loading branch information
mirceaulinic authored Jan 6, 2021
2 parents 13e8d5e + 394be2b commit 236be57
Show file tree
Hide file tree
Showing 7 changed files with 732 additions and 0 deletions.
3 changes: 3 additions & 0 deletions napalm/eos/eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,9 @@ def get_route_to(self, destination="", protocol="", longer=False):
if protocol == "bgp" or route_protocol.lower() in ("ebgp", "ibgp"):
nexthop_interface_map = {}
for next_hop in route_details.get("vias"):
if "vtepAddr" in next_hop:
next_hop["nexthopAddr"] = next_hop["vtepAddr"]
next_hop["interface"] = "vxlan1"
nexthop_ip = napalm.base.helpers.ip(next_hop.get("nexthopAddr"))
nexthop_interface_map[nexthop_ip] = next_hop.get("interface")
metric = route_details.get("metric")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"1.0.4.0/24": [{"current_active": true, "last_active": true, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "noReason", "routing_table": "TEST", "selected_next_hop": true, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.2", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.3", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.4", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.1", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.4", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.3", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.1", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.2", "preference2": 0, "communities": []}}, {"current_active": true, "last_active": true, "age": 0, "next_hop": "169.254.232.160", "protocol": "eBGP", "outgoing_interface": "Ethernet4/1", "preference": 20, "inactive_reason": "noReason", "routing_table": "default", "selected_next_hop": true, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.160", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.232.156", "protocol": "eBGP", "outgoing_interface": "Ethernet3/1", "preference": 20, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.156", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.232.148", "protocol": "eBGP", "outgoing_interface": "Ethernet1/1", "preference": 20, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.148", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.232.152", "protocol": "eBGP", "outgoing_interface": "Ethernet2/1", "preference": 20, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.152", "preference2": 0, "communities": []}}, {"current_active": true, "last_active": true, "age": 0, "next_hop": "169.254.232.160", "protocol": "eBGP", "outgoing_interface": "Ethernet4/1", "preference": 20, "inactive_reason": "noReason", "routing_table": "default", "selected_next_hop": true, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.160", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.232.156", "protocol": "eBGP", "outgoing_interface": "Ethernet3/1", "preference": 20, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.156", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.232.148", "protocol": "eBGP", "outgoing_interface": "Ethernet1/1", "preference": 20, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.148", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.232.152", "protocol": "eBGP", "outgoing_interface": "Ethernet2/1", "preference": 20, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.152", "preference2": 0, "communities": []}}]}
Loading

0 comments on commit 236be57

Please sign in to comment.