Administrative distance: how your router picks between two routes
A router often learns the same destination from more than one source. Which route it actually installs is decided by administrative distance (AD) — and AD is checked before metric, before path length, before anything protocol-specific.
AD comes first, metric second
Administrative distance is a trust ranking between route sources: the lower the number, the more trusted. When two sources offer the same prefix, the router installs the one with the lower AD and ignores the other. Metric (cost, hop count, and so on) only breaks ties within a single source — it never overrides AD.
The defaults that matter
- →Connected 0, Static 1
- →External BGP (eBGP) 20
- →Internal EIGRP 90
- →OSPF 110, IS-IS 115, RIP 120
- →Internal BGP (iBGP) 200
So an eBGP route (20) beats an OSPF route (110) for the same prefix, even when the OSPF path looks shorter. That surprises people who assume the IGP always wins.
Using AD on purpose: floating static routes
You can set AD deliberately to build failover. A floating static route is a static route given a high AD (say 200) so it stays out of the table while a dynamic route exists — and takes over only if that route disappears. It is the cleanest way to add a backup path without route-maps.