How a Cisco router chooses which route to place in its forwarding table (which route to use). If a Cisco router has the following five paths available to 10.1.1.1, which would it use:
· 10.1.1.0/24, metric 44560, EIGRP, administrative distance 90
· 10.1.1.0/24, metric 56540, EIGRP, administrative distance 90
· 10.1.1.0/24, metric 2, RIP, administrative distance 120
· 10.0.0.0/8, metric 12500, EIGRP, administrative distance 90
· 10.0.0.0/8, metric 1, static, administrative distance 200
A router first looks at the prefix length of the paths and chooses the one with the longest prefix (the most bits set, or the most 1s). Because the three routes to 10.1.1.0/24 have a longer prefix length than 10.0.0.0/8, the 10.1.1.0/24 routes are preferred.
But which of the three 10.1.1.0/24 routes should the router use? Two of these routes are learned through EIGRP, and the third through RIP. Because RIP uses hop count as it's metric, and EIGRP uses a metric based on bandwidth and delay, the metrics can't be compared between protocols. Because the router has no way to directly compare the various metrics and costs each protocol uses internally, it uses an external measure of the reliability of a protocol—the administrative distance. Lower administrative distances are preferred.
In this case, the path with an administrative distance of 120 is removed from the running, leaving the two paths with an administrative distance of 90. The router chooses between these two paths by looking at the internal metric of the protocol according to the rules of that protocol (in this case EIGRP) and choosing the one with the better metric. In this case, the first route is preferred. Because the administrative distance is so important in making routing decisions, it will be covered in a bit more detail. How is the administrative distance determined?
Each routing protocol has a default administrative distance:
· connected: 0
· static: 1
· EIGRP Summary: 5
· BGP External: 20
· EIGRP Internal: 90
· IGRP: 100
· OSPF: 110
· IS-IS: 115
· RIP: 120
· EGP: 140
· EIGRP External: 170
· BGP Internal: 200
· Unknown: 255
The administrative distance for connected routes cannot be changed, but it can be changed for other protocols. Each of the routing protocol's administrative distances can be changed using the distance command in router configuration mode. The administrative distance for each static route can be set using an option in the ip route command:
ip route 10.1.1.0 255.255.255.0 x.x.x.x 200
The ability to change the administrative distance of a static route this way has led to the concept of a floating static route, which is a static route with a high administrative distance, typically 200 or above. These floating statics are useful for backing up primary routes or conditionally advertising a route.