BGP Path Selection
BGP may receive multiple advertisements for the same route from different sources. BGP selects only one path as the best path. When this path is selected, BGP puts the selected path in the IP routing table and propagates the path to its neighbors. BGP uses the following criteria, in the order presented, to select a path for a destination:
-
If the path specifies a next hop that is inaccessible, drop the update.
-
Prefer the path with the largest weight.
-
If the weights are the same, prefer the path with the largest local preference.
-
If the local preferences are the same, prefer the path that was originated by BGP running on this router.
-
If no route was originated, prefer the route that has the shortest AS_path.
-
If all paths have the same AS_path length, prefer the path with the lowest origin type (where IGP is lower than EGP, and EGP is lower than incomplete).
-
If the origin codes are the same, prefer the path with the lowest MED attribute.
-
If the paths have the same MED, prefer the external path over the internal path.
-
If the paths are still the same, prefer the path through the closest IGP neighbor.
-
Determine if multiple paths require installation in the routing table for BGP Multipath.
-
If both paths are external, prefer the path that was received first (the oldest one).
-
Prefer the path with the lowest IP address, as specified by the BGP router ID.
-
If the originator or router ID is the same for multiple paths, prefer the path with the minimum cluster list length.
-
Prefer the path that comes from the lowest neighbor address.