BGP Path Attributes
Well-known mandatory
Well-known discretionary
Optional transitive
Optional non-transitive
How the Best Path Algorithm Works
BGP assigns the first valid path as the current best path. BGP then compares the best path with the next path in the list, until BGP reaches the end of the list of valid paths. This list provides the rules that are used to determine the best path:
Highest WEIGHT.
Highest LOCAL_PREF.
Locally originated via a network or aggregate BGP subcommand or through redistribution from an IGP.
Shortest AS_PATH.
Lowest origin type.
Lowest multi-exit discriminator (MED).
eBGP over iBGP paths.
Lowest IGP metric to the BGP next hop.
Determine if multiple paths require installation in the routing table for BGP Multipath.
When both paths are external, prefer the path that was received first (the oldest one).
Prefer the route that comes from the BGP router with the lowest 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.
Cisco BGP