For unicast routes, the routing protocol process uses the information in its routing table, along with the properties set in the configuration file, to choose an active route for each destination. While the software might know of many routes to a destination, the active route is the preferred route to that destination and is the one that is installed in the forwarding table and used when actually routing packets.
The routing protocol process generally determines the active route by selecting the route with the lowest preference value. The preference is an arbitrary value in the range 0 through 255 that the software uses to rank routes received from different protocols, interfaces, or remote systems.
When routes in the routing table are nearly identical, the routing protocol process prefers the route whose next hop has the lowest IP address.
The preference value is used to select routes to destinations in external ASs or routing domains; it has no effect on the selection of routes within an AS (that is, within an IGP). Routes within an AS are selected by the IGP and are based on that protocol's metric or cost value.
This section includes the following topics:
- Alternate and Tiebreaker Preferences
- How the Active Route Is Determined
- Multiple Active Routes
- Default Route Preference Values
Alternate and Tiebreaker Preferences
The software provides support for alternate and tiebreaker preferences, and some routing protocols use these additional preferences. With these protocols, you can specify a primary route preference,
preference, and a secondary preference,
preference2, that is used as a tiebreaker.
The software uses a four-byte value to represent the route preference value. When using the preference value to select an active route, the software first compares the primary route preference values, choosing the route with the lowest value. If there is a tie and if a secondary preference has been configured, the software compares the secondary preference values, choosing the route with the lowest value.
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:
- 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.
- Choose the path with the lowest
- Prefer strictly internal paths, which include IGP routes and locally generated routes (static, direct, local, and so forth).
- Prefer the path that was learned from the neighbor with the lowest peer IP address.
Multiple Active Routes
The interior gateway protocols (IGPs) compute equal-cost multipath next hops. When there are multiple, equal-cost next hops associated with a route, the routing protocol process installs only one of the next hops in the forwarding path with each route, randomly selecting which next hop to install. For example, if there are 3 equal-cost paths to an exit router and 900 routes leaving through that router, each of the paths ends up with about 300 routes pointing at it. This mechanism provides load distribution among the paths while maintaining packet ordering per destination.
Default Route Preference Values
The software routing protocol process assigns a default preference value to each route that the routing table receives. The default value depends on the source of the route. The preference is a value from 0 through 255, with a lower value indicating a more preferred route. Table 47 lists the default preference values.
Table 47: Default Route Preference Values
In general, the narrower the scope of the statement, the higher precedence its preference value is given, but the smaller the set of routes it affects. To modify the default preference value for routes learned by routing protocols, you generally apply routing policy when configuring the individual routing protocols. You also can modify some preferences with other configuration statements, which are indicated in the table. For information about defining and applying routing policies, see Routing Policies.