Administrative Distance
Cheat sheet · https://pcornel.dk/topic.php?topic=1066
Answer
Administrative distance is how much a router trusts a route source. When two sources offer the same prefix, the lower distance wins: connected 0, static 1, eBGP 20, EIGRP 90, OSPF 110, RIP 120, iBGP 200.
Remember
Distance only compares identical prefixes; a longer prefix still wins. Only the winner enters the routing table; the loser waits in its own protocol database. A floating static route uses a distance higher than the protocol so it only appears when the protocol route disappears.
First checks
show ip route <prefix>— the installed route with its distance and metric:[110/20].show ip protocols— distances configured per protocol.show ip ospf database,show ip eigrp topology <prefix>,show bgp ipv4 unicast <prefix>— the route the loser still knows.show running-config | include ip route— static routes and their distances.
Commands
ip route ... 130show ip routeshow ip route 203.0.113.0 255.255.255.0show ip cef 203.0.113.42
Verify in this order
same prefix offered by several sources → lowest administrative distance installed → others kept in their protocol databases → winner forwards → loser takes over if the winner disappears
Where it usually breaks
candidate absent/ineligible → unintended local preference → unresolved backup next hop → installed route with broken remote/return path
Administrative Distance operational reference
| Check | Known-good | Failure signature | Next boundary |
|---|---|---|---|
| Prefix | Exact same destination prefix | Different masks compared | Scope error |
| Candidates | Eligible sources enumerated | Configured-only candidate assumed | Eligibility |
| AD | Intended lower value wins | Unexpected source preference | RIB policy |
| Metric | Compared only within protocol rules | Cross-protocol numeric compare | Metric semantics |
| Failover | Higher-AD backup activates | Always/never active | Floating design |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=1066