diff --git a/napalm/eos/eos.py b/napalm/eos/eos.py index b7ddf7b4a..8bd012639 100644 --- a/napalm/eos/eos.py +++ b/napalm/eos/eos.py @@ -1245,7 +1245,13 @@ def get_route_to(self, destination="", protocol=""): as_path = bgp_route_details.get("asPathEntry", {}).get( "asPath", "" ) - remote_as = int(as_path.strip("()").split()[-1]) + as_path_type = bgp_route_details.get("asPathEntry", {}).get( + "asPathType", "" + ) + if as_path_type in ["Internal", "Local"]: + remote_as = local_as + else: + remote_as = int(as_path.strip("()").split()[-1]) remote_address = napalm.base.helpers.ip( bgp_route_details.get("routeDetail", {}) .get("peerEntry", {})