- Discard routes where the next-hop is inaccessible (thus, needs IGP route to next-hop address)
- Prefer the path with the largest weight (Cisco proprietary, local, per-router)
- If the weights are the same, prefer the route with the largest local preference (local-pref is distributed via iBGP, so is «AS-local»).
- If the routes have the same local preference, prefer the route that was locally originated (by this router).
- If the local preference is the same, prefer the route with the
shortest AS_path (unless
bgp bestpath as-path ignoreis configured) - If the AS_path length is the same, prefer the route with the
lowest origin type (
IGP < EGP < Incomplete). - If the origin type is the same, prefer the route with the lowest
MED (multi-exit discriminator). Cisco knobs:
bgp always-compare-med,bgp bestpath med-confed,bgp deterministic-med. - If the routes have the same MED, prefer in the following manner: External (eBGP) is better than Confederation External which is better than Internal (iBGP).
- If all the preceding comparisons are identical, prefer the route that can be reached via the closest IGP neighbor, i.e. take the shortest internal path inside the AS to reach the destination (follow the shortest path to the BGP NEXT_HOP). This results in what is commonly referred to as hot potato routing, because you give the «problem» (packet carriage) as quickly as possible to the next guy.
- If both paths are external, prefer the oldest route, unless
bgp bestpath compare-routeridhas been configured. - If the internal path is the same, the BGP router ID will be a tie braker. Prefer the route coming from the BGP router with the lowest router ID. The router ID is usually the highest IP address on the router or the loopback (virtual) address. The router ID could be implementation specific.
- If the router ID is the same, prefer the path with the minimum cluster ID length (only relevant for route reflector configs)
- Prefer the path coming from the lowest neighbor address.
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml
Comments