On Cisco routers running more than one routing protocol, it is possible for two different routing protocols to have a route to the same destination. Cisco routers assign each routing protocol an administrative distance. When multiple routes exist for a destination, the router selects the longest match. For example, to reach the destination 170.20.10.1, if OSPF has a route prefix of 170.20.10.0/24, and EIGRP has a route prefix of 170.20.0.0/16, the OSPF route is preferred because the /24 prefix is longer than the /16 prefix. This means it is more specific.
If two or more routing protocols offer the same route (with the same prefix length) for inclusion in the routing table, the Cisco IOS router selects the route with the lowest administrative distance.
The administrative distance is a rating of the trustworthiness of a routing information source. Table 3-5 shows the default administrative distances for configured (static) or learned routes. In the table, you can see that static routes are trusted over dynamically learned routes. With IGP routing protocols, EIGRP internal routes are trusted over OSPF, IS-IS, and RIP routes.
Table 3-5 Default Administrative Distances for IP Routes
IP Route | Administrative Distance |
Connected interface | 0 |
Static route directed to a connected interface | 1 |
Static route directed to an IP address | 1 |
EIGRP summary route | 5 |
External BGP route | 20 |
Internal EIGRP route | 90 |
IGRP route | 100 |
OSPF route | 110 |
IS-IS route | 115 |
RIP route | 120 |
EGP route | 140 |
External EIGRP route | 170 |
Internal BGP route | 200 |
Route of unknown origin | 255 |
The administrative distance establishes the precedence used among routing algorithms. Suppose a router has an internal EIGRP route to network 172.20.10.0/24 with the best path out Ethernet 0 and an OSPF route for the same network out Ethernet 1. Because EIGRP has an administrative distance of 90 and OSPF has an administrative distance of 110, the router enters the EIGRP route in the routing table and sends packets with destinations of 172.20.10.0/24 out Ethernet 0.
Static routes have a default administrative distance of 1. You can configure static routes with a different distance by appending the distance value to the end of the command.
Table 3-6 provides a summary of routing protocol characteristics.
Table 3-6 Routing Protocol Characteristics
Routing Protocol | Distance Vector or Link State | Interior or Exterior | Classful or Classless | Administrative Distance |
RIPv2 | Distance vector | Interior | Classless | 120 |
EIGRP | Distance vector (hybrid) | Interior | Classless | 90 (170 if external) |
OSPF | Link state | Interior | Classless | 110 |
IS-IS | Link state | Interior | Classless | 115 |
BGP | Path vector | Both | Classless | 20 (200 if internal) |