Routing
Administrative distance, explained properly
Applies to Cisco IOS / IOS-XE This applies to Cisco IOS and IOS-XE, whose default values are listed; other vendors use the same idea with their own names and numbers.
Administrative distance decides which source a router believes when two protocols offer a route to the same destination. It is widely misunderstood in two specific ways, and both cause real problems.
It is not a metric
A metric compares routes within one protocol: which OSPF path is better. Administrative distance compares protocols: should I believe OSPF or EIGRP for this prefix. The router picks the lower distance and installs that route. The other is kept but not used.
It is local to the router
This is the part that catches people. Administrative distance is never advertised. Changing it on one router changes only that router’s decision. Neighbours are unaffected and will keep making their own choices.
That is why changing AD to fix a path problem so often produces asymmetric routing: you have changed one router’s mind and nobody else’s.
The common values
Connected 0, static 1, eBGP 20, EIGRP internal 90, OSPF 110, RIP 120, EIGRP external 170, iBGP 200. The ordering encodes a rough judgement about trustworthiness: directly attached beats manually configured, which beats learned.
Where it is genuinely useful
A floating static route is the good example. Give a backup static route a distance higher than the dynamic protocol, and it sits unused until the dynamic route disappears:
ip route 0.0.0.0 0.0.0.0 192.0.2.1 200
Clean, predictable, and it does not require the backup path to run a routing protocol at all.
Where it causes trouble
Using it to force a path during redistribution. It works on the router you changed and creates inconsistency everywhere else. If you find yourself adjusting AD to make traffic take a particular path, the underlying problem is usually redistribution design, and AD is treating the symptom.
show ip route 10.1.1.0 # shows the distance and metric
show ip protocols # per-protocol distances
Related reading