Routing · 4 min read

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

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.

Administrative distance reference
The full default AD table, searchable.
Open →
Practise this on today’s Daily Ops Drill — a free network task every day.
Open the app →
Free tools for this
More from the blog
MTU, MSS, and why your VPN tunnels drop large packetsRead →169.254.x.x address on your interface: what APIPA really meansRead →