BGP best-path calculation
Highest administrative weight: Administrative weight can be assigned to each NLRI locally on a router and the value cannot be communicated to another router. A higher value indicates a better route.
Highest LOCAL_PREF PA: This attribute can be set on a router inside an AS and distributed inside the AS. A higher value indicates a better route.
Locally injected routed: Pick the route injected into BGP locally using the network command
redistribution
.Shortest AS_PATH length: A shorter AS_PATH indicates a better route. This attribute counts each ASN in the AS_SEQUENCE as one.
Origin PA: IGP (I) routes are preferred over EGP (E) routes, which are in turn preferred over incomplete (?) routes.
Smallest Multi-Exit Discriminator (MED) PA: A smaller value indicates a better route.
Neighbor Type: External BGP (eBGP) routes are better than internal BGP (iBGP) routes.
IGP metric for reaching the NEXT_HOP: When comparing IGP metrics for each NLRIs NEXT_HOP, a smaller value indicates a better route.
Keep the oldest eBGP route: If the routes being compared are eBGP and one is the best path, retain the existing best path. This action reduces eBGP route flaps.
Choose the smallest neighbor router ID: Use the route with the smallest next-hop router router-id. Only perform this step if bgp bestpath compare-routerid is configured.
Smallest neighbor ID: The local router has at least two neighbor relationships with a single other router. For this case, the router prefers the route advertised by the lowest neighbor ID.