When a router compares two identical prefixes, first it looks at the administrative distance. If it is the same (the same source protocol), then it compares the metric (distance/cost/hop-count/etc) to determine which of these two routes should be installed in the routing table. If the administrative distances are different, it chooses the route with smaller administrative distance. Here is the default administrative distances for various routing protocols:
Connected interfaces | 0 | ||||
Static routes | 1 | ||||
EIGRP summary route | 5 | ||||
External BGP | 20 | ||||
Internal EIGRP | 90 | ||||
IGRP | 100 | ||||
OSPF | 110 | ||||
IS-IS | 115 | ||||
RIP | 120 | ||||
EIGRP external route | 170 | ||||
Internal BGP | 200 | ||||
Unknown | 255 |
Administrative distance (AD) has local significance meaning that it is only known on that particular router and is not propagated to other routers. Its value can be changed using the “distance” command:
OSPF does not allow to overwrite its rule for intra-inter-external routes: O is preferred over O IA which is preferred over O E1/E2. So the second OSPF distance command without the access-list-number only works for host routes.
AD can also be specified per route rather than per class of routes, except for EIGRP external routes. OSPF or EIGRP distance command accepts the access-list-number to match a particular route.
The routing loops can be prevented by:
A tag can be assigned via route-map “set tag” command by distribute-list or redistribute commands. The tag value should survive further redistribution but not all routing protocols do it by default; for example, OSFP has to be forced to re-apply the tag. Router’s internal routes (advertised via a “network” command) do not have a field for a tag though, only redistributed routes do.
Path manipulation is useful when the network topology has two or more ASBRs for symmetric routing, load balancing, preferring one path over the other, etc. It can be done by one of the following methods: