Manipulating Administrative Distance

Manipulating Administrative Distance
When a router receives routes to the same destination network from more
than one routing process, it decides which to put in the routing table by
looking at the administrative distance (AD) value assigned to the routing
process. The route with the lowest AD is chosen. Table 5-2 shows administrative
distance values.
Table 5-2 Administrative Distance
Routing Information Source Administrative Distance
Connected interface 0
Static route 1
EIGRP summarized route 5
BGP external route 20
EIGRP internal route 90
IGRP 100
OSPF 110
IS-IS 115
RIP 120
EIGRP external route 170
BGP internal route 200
Unknown 255
AD can be changed for all routes of a process or only for specific routes
within a process. The command for all IGPs except EIGRP is:
Router(config-router)#distance administrative_distance {address
wildcard-mask} [access-list-number | name]
Using the address/mask keywords in the command changes the AD of
routes learned from the neighbor with that IP address. An entry of 0.0.0.0
255.255.255.255 changes the AD of all routes. Specifying an access list
number or name changes the AD only on networks permitted in the ACL.
EIGRP and BGP have different AD values for internal and external routes,
so you have to list those separately when using the command with those
protocols. BGP also allows you to change the AD for locally generated
routes. For these protocols, the commands are:
Router(config-router)#distance eigrp internal-distance externaldistance
Router(config-router)#distance bgp external-distance internaldistance
local-distanceRoute redistribution can cause suboptimal routing; one way to correct this is
to adjust AD. Figure 5-1 shows a network with two routing domains: RIP
and OSPF.