Administrative distance (AD) is a numeric value that a router assigns to each source of routing information to express how trustworthy that source is, where a lower value wins. In routing, it decides which route reaches the routing table when two or more sources, such as a static route and OSPF, offer a path to the same destination prefix.
The concept matters in every multi-protocol network because routing protocols measure paths with incompatible metrics. A RIP hop count cannot be compared with an OSPF cost or an EIGRP composite metric, so the router needs an independent tiebreaker. Administrative distance is that tiebreaker, and it is applied before any metric comparison across protocols.
How administrative distance selects a route
Administrative distance acts as a filter between the routing protocols and the routing table. Each protocol runs its own best-path calculation and offers its winner, the candidate route, to the routing table manager. When several candidates for an identical prefix arrive, the manager installs only the one with the lowest administrative distance; the others remain in their protocol databases as backups.
The comparison applies only to routes with exactly the same prefix and prefix length. A route to 10.1.0.0/16 learned through OSPF and a route to 10.1.1.0/24 learned through RIP are different entries, and both are installed. During forwarding, longest prefix match then chooses the more specific /24 regardless of its higher distance. This order of operations is the most frequently misunderstood point about the value.
The selection process follows a fixed sequence on most platforms:
- Each protocol selects its own best path using its internal metric.
- The routing table manager compares candidates for the same prefix by administrative distance.
- The route with the lowest value is installed; a tie between distinct protocols is resolved by vendor-specific rules.
- The forwarding plane later applies longest prefix match across all installed entries.
The value is locally significant. It is never carried in routing updates, so two neighboring routers can rank the same protocol differently without any protocol error.
Default administrative distance values
Vendors publish default distances that reflect how reliable each source is assumed to be. The following table lists the widely cited Cisco IOS defaults, which many other platforms either mirror or use as a reference point.
| Route source | Default value | Reasoning |
|---|---|---|
| Connected interface | 0 | The router has direct knowledge of the subnet |
| Static route | 1 | An administrator configured it explicitly |
| External BGP | 20 | Learned from another autonomous system |
| EIGRP internal | 90 | Rich composite metric inside one domain |
| OSPF | 110 | Link-state view of the whole area |
| IS-IS | 115 | Link-state, similar trust to OSPF |
| RIP | 120 | Simple hop count, slow convergence |
| EIGRP external | 170 | Redistributed into EIGRP from elsewhere |
| Internal BGP | 200 | Learned from peers inside the same AS |
| Unknown source | 255 | Never installed in the routing table |
Two values deserve attention. A distance of 255 means unusable: the route is kept out of the table entirely. Internal BGP receives a deliberately high 200 so that an interior gateway protocol route to the same prefix is preferred, which prevents traffic inside the autonomous system from following a BGP next hop that the IGP itself must resolve.
Administrative distance compared with metric and vendor equivalents
Administrative distance and routing metric answer different questions. Distance chooses between sources, while a metric chooses between paths within one source. Confusing the two leads to configurations that change costs when the real conflict is between protocols.
| Attribute | Administrative distance | Routing metric |
|---|---|---|
| Question answered | Which protocol is trusted more | Which path is shorter or cheaper |
| Scope | Between different route sources | Within a single protocol |
| Carried in updates | No, local only | Yes, accumulated hop by hop |
| Typical range | 0 to 255 | Protocol-specific, such as 1 to 15 hops |
| When applied | Before table installation | During protocol path calculation |
Other vendors implement the same idea under different names and scales. Juniper Junos calls it route preference and uses values such as 0 for direct routes, 5 for static routes, 10 for internal OSPF and 170 for BGP. The principle is identical, yet mixed-vendor designs must translate values carefully, because a number that is low on one platform can be mid-range on another.
Floating static routes and other practical uses
Changing administrative distance is a precise design tool rather than a troubleshooting reflex. The most common application is the floating static route: a static route configured with a distance higher than the dynamic protocol, so it stays hidden while the dynamic route exists and appears automatically when that route disappears.
| Situation | Adjustment | Result |
|---|---|---|
| Backup link over LTE or VPN | Static route with distance 250 | Used only when the dynamic route fails |
| Migration from RIP to OSPF | Raise OSPF above 120 temporarily | Old protocol stays authoritative during cutover |
| Prefer IGP over eBGP | BGP backdoor or higher eBGP distance | Internal path wins for a shared prefix |
| Two redistribution points | Raise distance of redistributed routes | Prevents suboptimal paths and loops |
| Block a specific prefix | Set distance 255 for that source | Route never enters the table |
Most platforms allow distance changes per protocol, per neighbor or per prefix through an access list. Narrow scoping is preferable, because a global change affects every route the protocol carries and can shift traffic unexpectedly across the whole network.
Common mistakes and failure modes
Most problems with administrative distance arise where several protocols meet, especially at redistribution points. The value itself is simple, but its interactions with prefix length, recursion and redistribution produce subtle faults.
- Expecting distance to beat a longer prefix: a more specific route always wins in forwarding, whatever its distance.
- Floating route with too low a value: a static backup set to distance 1 overrides the primary dynamic route permanently.
- Mutual redistribution loops: a route redistributed from OSPF into EIGRP and back can return with a better distance than its original source.
- Static route to an unreachable next hop: some platforms keep it installed, so the backup never activates; tracking objects or BFD solve this.
- Assuming identical defaults across vendors: values copied from one platform rarely match another.
The reliable diagnostic is to inspect the routing table entry itself, which on most platforms shows the distance and metric in brackets, such as [110/20] for an OSPF route with cost 20. Comparing that value with the protocol database reveals which candidate lost and why.
Put simply
A router often hears about the same destination from several advisers at once. Administrative distance is the router’s ranking of how much it trusts each adviser. A cable plugged directly into the router is trusted completely, a route typed in by an administrator comes next, and information from routing protocols follows in a fixed order.
When two advisers disagree, the router simply listens to the one it trusts most, the one with the lower number. It does not try to compare their different ways of measuring distance, because those measurements are like comparing kilometers with minutes.
In practice
A retail company connects each store to its data center over a fiber circuit running OSPF, with an LTE router as a backup. The network engineer adds a static default route toward the LTE router with an administrative distance of 250. Because OSPF advertises the default route at distance 110, the static route remains inactive during normal operation.
When a construction crew cuts the fiber at one store, the OSPF adjacency drops within about 40 seconds of dead interval, the OSPF default route is withdrawn, and the floating static route is installed immediately. Card payments continue over LTE. Once the fiber is repaired, OSPF returns and automatically displaces the backup without any manual change.