While I can't find anything in the exam outline dealing specifically with administrative distance, it is such an important thing I'm going to cover it anyway. My guess is that it falls under
Cisco IOS supports many different routing protocols. It is possible that multiple protocols have information on the same route, so which one makes it to the routing table?
Working from the top, there are many routes in the network. Each routing protocol that knows about the route makes its own decision about their best path. For example, if 10.0.0.0/8 exists in the network, RIP may know two ways to get there, one with a hop count of 5 and the other with a hop count of 7. RIP then elects the path with the count of 5 to be its best route. However OSPF may also know multiple ways to get to the same route within its domain, so the best is chosen by OSPF.
Which one gets put in the routing table? This is where administrative distance (AD) comes in. Each routing process nominates their best routes and passes them to the routing engine tagged with a number known as the AD. By default, each routing protocol has their own AD and passes this off to the route, though this can be overidden as need be. The routing engine then picks the route with the lowest AD and puts it in the routing table.
The routing process is concerned with the route's metric. The routing engine is concerned with AD, because it has no way to compare a RIP hop count of 5 with an OSPF cost of 1000.
By default, each routing protocol has an assigned AD:
| Route Source | Default Distance Values |
|---|---|
| Connected interface | 0 |
| Static route | 1 |
| Enhanced Interior Gateway Routing Protocol (EIGRP) summary route | 5 |
| External Border Gateway Protocol (BGP) | 20 |
| Internal EIGRP | 90 |
| IGRP | 100 |
| OSPF | 110 |
| Intermediate System-to-Intermediate System (IS-IS) | 115 |
| Routing Information Protocol (RIP) | 120 |
| Exterior Gateway Protocol (EGP) | 140 |
| On Demand Routing (ODR) | 160 |
| External EIGRP | 170 |
| Internal BGP | 200 |
| Unknown | 255 |
There is some reasoning behind the selection of numbers. For interior gateway protocols (EIGRP, OSPF, IS-IS, RIP, static/connected), the more "specific" the route, the lower the AD. EIGRP has the five metrics (bandwidth, delay, reliability, load, MTU) and is therefore more specific than something like RIP which has a mere hop count. Internal routes (BGP aside) are better than External routes. Sometimes, you'll see "believable" used instead of specific.
So, looking at an entry in the routing table:
1 2 3 4 5 6 7 D 192.168.246.0/24 [90/183736] via 1.1.1.1, 2d16h, ATM1/0.222
#2, 3, 4, and 5 are what's needed to route, BTW.
The distance command within the routing process is used to change the AD. Depending on the routing process the arguments may be different.
r0#show ip route 192.168.3.0 | include distance Known via "isis", distance 115, metric 10, type level-1 r0#conf t Enter configuration commands, one per line. End with CNTL/Z. r0(config)#router isis r0(config-router)#distance 100 ip r0#clear ip route * r0#show ip route 192.168.3.0 | include distance Known via "isis", distance 100, metric 10, type level-1
Another thing to know is the floating static. Static routes normally have an AD of 1, meaning they beat out any dynamically learned route. However, if you want to have something like a BRI take over if a WAN circuit goes down, you can put in a static route with a higher AD.
Here, you can see that IS-IS has chosen 10.50.0.2 as the default route:
r0#show ip route ... Gateway of last resort is 10.50.0.2 to network 0.0.0.0 ... i*L1 0.0.0.0/0 [100/10] via 10.50.0.2, Ethernet0
I'll add in the floating static default route to 10.50.0.254:
r0#conf t Enter configuration commands, one per line. End with CNTL/Z. r0(config)#ip route 0.0.0.0 0.0.0.0 10.50.0.254 ? <1-255> Distance metric for this route name Specify name of the next hop permanent permanent route tag Set tag for this router0(config)#ip route 0.0.0.0 0.0.0.0 10.50.0.254 250
r0(config)#end
(I used the help command to show there are more options after the next hop)
Since the newer route has a higher AD, it isn't chosen to go into the ip routing table:
r0#show ip route ... Gateway of last resort is 10.50.0.2 to network 0.0.0.0 ... i*L1 0.0.0.0/0 [100/10] via 10.50.0.2, Ethernet0
But if I kill IS-IS it comes into effect:
r0#conf t Enter configuration commands, one per line. End with CNTL/Z. r0(config)#no router isis r0(config)# r0#show ip route ... Gateway of last resort is 10.50.0.254 to network 0.0.0.0 ... S* 0.0.0.0/0 [250/0] via 10.50.0.254
(Since my default routes were both out the same interface I couldn't just shut it down, since neither route would have made it. Remember that for a route to make it to the ip routing table, the router must know that the next hop is reachable)
Updated on Aug 14/04: Found the following link from CCO: Route Selection in Cisco Routers
Tags: