Routing Protocol Preference
Routing protocols (including static routing) may discover different routes to the same destination, but not all routes are optimal. Only one routing protocol at a time determines the optimal route to a destination. To select the optimal route, each routing protocol (including static routing) is assigned a preference (a smaller value indicates a higher preference). When multiple routing information sources coexist, the route discovered by the routing protocol with the highest preference is selected as the optimal route and added to the local routing table.
Routers define external preference and internal preference. In Table 1-1, the value 0 indicates direct routes and the value 255 indicates routes learned from unreliable sources. A smaller value indicates a higher preference. External preference is manually configured for each routing protocol. Table 1-1 lists the default external preferences of routing protocols.
Routing Protocol or Route Type |
Default External Preference |
---|---|
Direct |
0 |
OSPF |
10 |
IS-IS |
15 |
Static |
60 |
RIP |
100 |
OSPF ASE |
150 |
OSPF NSSA |
150 |
IBGP |
255 |
EBGP |
255 |
CE series switches allow users to manually configure the preference of direct routes. In addition, the preference of each static route varies.
Internal preferences of routing protocols cannot be manually configured. Table 1-2 lists the internal preferences of routing protocols.
Routing Protocol or Route Type |
Internal Preference |
---|---|
Direct |
0 |
OSPF |
10 |
IS-IS Level-1 |
15 |
IS-IS Level-2 |
18 |
Static |
60 |
RIP |
100 |
OSPF ASE |
150 |
OSPF NSSA |
150 |
IBGP |
200 |
EBGP |
20 |
During route selection, a router first compares the external preferences of routes. When the same external preference is set for different routing protocols, the router selects the optimal route based on the internal preference. For example, assume that there are two routes to 10.1.1.0/24: a static route and an OSPF route. Both routes have the same external preference: 5. In this case, the router determines the optimal route based on the internal preference listed in Table 1-2. An OSPF route has an internal preference of 10, and a static route has an internal preference of 60. This indicates that the OSPF route has a higher preference than the static route, so the router selects the OSPF route as the optimal route.