Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Administrative Distance · Forwarding Decision

Direct 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.

When to use this

Use it when the same prefix is learned from two sources and the wrong one is used — typically a static route overriding a routing protocol, or redistribution loops.

First 30 seconds

1. show ip route <prefix> — which source won, at which distance?

2. Check the other source has the same prefix (same length), not a longer or shorter one.

3. Static winning over a protocol unintentionally → give it a higher distance (floating static) or remove it.

4. Redistributed route winning → check distances on both sides of the redistribution.

5. Verify again with show ip route <prefix>.

Operational verification

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

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Cisco IOS / IOS XE
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCisco IOS / IOS XE · Cisco IOS XE
Scope / prerequisiteUse it when the same prefix is learned from two sources and the wrong one is used — typically a static route overriding…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Forwarding Decision / AD: closure without cross-prefix comparisons Verify boundary

Closure requires an explanation of the selected prefix for each test destination, the source that owns that prefix, the resolved next hop and the actual sourced traffic/return path. A correct RIB lookup is not complete evidence of packet delivery.

Record the two decisions separately: (1) which eligible source installs each exact prefix; (2) which installed prefix wins the destination's longest-prefix lookup. Do not present AD, protocol metric and mask length as one universal numeric ranking.

For the /25-withdrawal lab, restore the original advertisement and wait for installation/convergence. Recheck both .42 and .200, including one unchanged application flow. A changed path alone is not evidence of recovery if return traffic or downstream filtering still fails. No canonical rows are merged or deleted by coordinating these three AD Topics; each retains its own role and history.

Step 2 Forwarding Decision / AD: prove the two packet outcomes Narrow the fault

For the illustrative overlapping routes, first inspect the exact RIB entries with show ip route 203.0.113.0 255.255.255.0 and show ip route 203.0.113.0 255.255.255.128. Then inspect destination lookups with show ip route 203.0.113.42 and show ip route 203.0.113.200; inspect CEF for each destination independently.

If the /25 is absent, investigate its protocol/policy/eligibility before discussing packet selection. If both prefixes exist but CEF or traffic differs from the expected lookup, inspect recursion, adjacency, source/VRF context and configured forwarding policy.

In an isolated lab, withdraw only the /25 and observe .42 fall back to the /24 while .200 keeps its /24 lookup. Restore the /25 and verify both outcomes again. Preserve the exact original route advertisements/configuration and return paths. Do not change AD to simulate removal of a different-length route.

Commands and outcomes are authored examples for Cisco IOS / IOS XE global IPv4 unicast, not captured device output.

Step 3 Common mistakes Narrow the fault
  • Changing AD to fix a problem that is really a prefix-length difference.
  • Floating static route with AD lower than the dynamic route it should back up.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

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.

Key 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.
ReferenceHow it works1 section · depth on demand

Forwarding Decision / AD: separate RIB choice from packet lookup

This Topic owns the distinction between route installation and destination lookup. Use [Routing Table / AD](topic.php?topic=1066&view=deep) for competing sources of one exact prefix and the floating-static lab; use [RIB/FIB/CEF / AD](topic.php?topic=2604&view=deep) for programmed forwarding.

The RIB can contain multiple overlapping prefixes. AD helps choose the source for the same prefix; it does not rank different prefix lengths. Once routes are installed, ordinary destination-based forwarding selects the longest matching installed prefix. Policy-based routing or other explicit forwarding features need separate scope.

Illustrative installed routes:

PrefixSource and ADNext hop
203.0.113.0/24static, AD 1192.0.2.2
203.0.113.0/25OSPF, AD 110198.51.100.2

Both can be installed because their prefix lengths differ. Destination 203.0.113.42 matches both and uses /25; 203.0.113.200 uses /24. The lower AD of the /24 does not override the /25.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Administrative distance in the forwarding decision

In the forwarding decision, administrative distance acts before the packet arrives: it decides which source's route is installed in the RIB, and therefore what the FIB will use. Prefix length still comes first at lookup time. Cisco's IOS XE routing guide gives the related rule for backups: a static route with a higher distance than a dynamic protocol's is overridden by the dynamic route, which is how floating static routes work.

Order of decisions

StageQuestionDecided by
Route installationWhich source's route for this exact prefix goes into the RIB?Administrative distance
Within one protocolWhich path for the prefix?The protocol's metric
Packet lookupWhich installed prefix matches the destination?Longest prefix match

Worked example

Candidate for 10.70.0.0/16DistanceResult
Static via 10.0.13.2 (configured with 130)130Floating backup, not installed
OSPF via 10.0.12.2110Installed
iBGP via 10.255.0.3200Not installed (RIB failure in BGP)
R1(config)# ip route 10.70.0.0 255.255.0.0 10.0.13.2 130
R1# show ip route 10.70.0.0 | include Known
  Known via "ospf 1", distance 110, metric 21, type intra area
R1(config)# interface GigabitEthernet0/0/1
R1(config-if)# shutdown
R1# show ip route 10.70.0.0 | include Known
  Known via "static", distance 130, metric 0
R1# show ip bgp rib-failure

Per-source tuning (routing guide)

distance <ad> <source> <wildcard> [acl] sets a distance for routes from a particular neighbour or prefix; the guide notes that order matters, because a later prefix-based command can override an earlier one.

Pitfalls

PitfallEffect
Lowering a protocol's distance network-wideUnexpected path changes
Floating static with distance below the dynamic protocolThe static always wins
Redistributing between two protocols at two pointsRoutes can return with a better distance and loop

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Quick reference

In the forwarding decision, administrative distance acts only when two sources offer exactly the same prefix and prefix length. A longer prefix always wins in the forwarding lookup, regardless of AD.

ip route 10.20.0.0 255.255.255.0 10.0.0.9        ! static, AD 1
! OSPF also learns 10.20.0.0/24 (AD 110)  → static is installed
! OSPF learns 10.20.0.0/25 (AD 110)       → both installed; /25 used for .0–.127

Documented example, not captured output.

This is a common surprise: a more specific dynamic route overrides a less specific static route for part of the range.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

Authoritative/upstream documentation reviewed for bounded claims in Routing → Forwarding Decision → Administrative Distance. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%
Confirmation

Confirm action

Continue?