[an error occurred while processing this directive][an error occurred while processing this directive]

How the Active Route Is Determined

For each prefix in the routing table, the routing protocol process selects a single best path, called the active route. The algorithm for determining the active route is as follows:

  1. Choose the path with the lowest preference value (routing protocol process preference). Routes that are not eligible to be used for forwarding (for example, because they were rejected by routing policy or because a next hop is inaccessible) have a preference of –1 and are never chosen.
  2. For BGP, prefer the path with higher local preference. For non-BGP paths, choose the path with the lowest preference2 value.
  3. If the path includes an AS path:
    1. Prefer the route with a shorter AS path.

      Confederation sequences are considered to have a path length of 0, and AS and confederation sets are considered to have a path length of 1.

    2. Prefer the route with the lower origin code. Routes learned from an IGP have a lower origin code than those learned from an EGP, and both have lower origin codes than incomplete routes (routes whose origin is unknown).
    3. Depending on whether nondeterministic routing table path selection behavior is configured, there are two possible cases:
      • If nondeterministic routing table path selection behavior is not configured (that is, if the path-selection cisco-nondeterministic statement is not included in the BGP configuration), for paths with the same neighboring AS numbers at the front of the AS path, prefer the path with the lowest multiple exit discriminator (MED) metric. Confederation AS numbers are not considered when deciding what the neighbor AS number is. When you display the routes in the routing table using the show route command, they generally appear in order from most preferred to least preferred. Routes that share the same neighbor AS are grouped together in the command output. Within a group, the best route is listed first and the other routes are marked with the NotBest flag in the State field of the show route detail command.
      • To always compare MEDs whether or not the peer ASs of the compared routes are the same, include the path-selection always-compare-med statement. For an example, see Configuring Routing Table Path Selection for BGP.

      If nondeterministic routing table path selection behavior is configured (that is, the path-selection cisco-nondeterministic statement is included in the BGP configuration), prefer the path with the lowest MED metric. When you display the routes in the routing table using the show route command, they generally appear in order from most preferred to least preferred and are ordered with the best route first, followed by all other routes in order from newest to oldest.

      In both cases, confederations are not considered when determining neighboring ASs. Also, in both cases, a missing metric is treated as if a MED were present but zero.

  4. Prefer strictly internal paths, which include IGP routes and locally generated routes (static, direct, local, and so forth).
  5. Prefer strictly external (EBGP) paths over external paths learned through interior sessions (IBGP).
  6. For BGP, prefer the path whose next hop is resolved through the IGP route with the lowest metric.
  7. For BGP, if both paths are external, prefer the currently active path to minimize route-flapping. This rule is not used if:
    1. path-selection external-router-id is configured.
    2. Both peers have the same router-id.
    3. Either peer is a confederation peer.
    4. Neither path is the current active path.
  8. For BGP, prefer the path from the peer with the lowest router ID; for any path with an originator ID attribute, substitute the originator ID for the router ID during router ID comparison.
  9. For BGP, prefer the path with the shortest cluster list length; length is 0 for no list.
  10. For BGP, prefer the path from the peer with the lowest peer IP address.

Published: 2010-04-14

[an error occurred while processing this directive]