CCNA online course

Administrative Distance (AD) Explained for CCNA

Learn how Cisco routers use administrative distance, routing metrics, and longest-prefix matching to select IPv4 and IPv6 routes.

Administrative distance (AD) is a local trust ranking that a router assigns to route sources. It helps the router choose between equally specific routes to the same destination when those routes were learned from different sources, such as a static route, OSPF, or RIP.

The lower the administrative distance, the more preferred the route source. Administrative distance is locally significant: it is configured and evaluated independently on each router. Routers do not exchange AD as a routing-protocol metric.

This lesson assumes familiarity with IPv4 and IPv6 prefixes, subnetting, static routes, routing tables, and basic Cisco IOS commands. For related fundamentals, see the computer network explained lesson and the OSPF configuration lesson.

What Administrative Distance Does

A router can learn the same destination prefix from multiple route sources. For example, a router might have a manually configured static route and an OSPF-learned route for 192.0.2.0/24. The router needs one preferred route for its routing database and forwarding process.

Administrative distance answers this question: How much should this router trust the source of each candidate route? A normal static route has a default AD of 1, while an OSPF route has a default AD of 110. If both routes are equally specific and valid, the static route wins because 1 is lower than 110.

Administrative Distance Versus Routing Metric

A routing metric is a protocol-specific measurement used to select among routes learned by the same routing protocol. Depending on the protocol, a metric can use hop count, bandwidth, delay, cost, or a composite calculation.

CharacteristicAdministrative distanceRouting metric
PurposeRanks different route sourcesChooses among paths within a routing protocol
ScopeLocal to one routerDefined by the routing protocol
Compared betweenStatic, OSPF, RIP, EIGRP, BGP, and other sourcesRoutes learned through the same protocol
Typical inputsConfigured or default source preferenceHop count, cost, bandwidth, delay, or composite values
Effect of changing itCan change which source is installedCan change which path a protocol selects

Administrative distance is normally considered before a protocol metric when equally specific candidates come from different sources. A RIP hop count cannot be directly compared with an OSPF cost. If OSPF wins the administrative-distance comparison, the router then uses OSPF cost to select between eligible OSPF paths.

Equal administrative distance does not mean equal metric. Two OSPF routes have the same default AD of 110 but can have different OSPF costs. The lower-cost OSPF path is preferred.

Route Selection Order

Route selection begins with the destination address and proceeds through increasingly specific decisions.

Decision stageWhat is comparedExample result
Destination matchingWhether a candidate prefix contains the destination address10.10.0.0/16 matches 10.10.2.5
Prefix specificityPrefix length among matching routes10.10.2.0/24 beats 10.10.0.0/16
Administrative distanceTrust of the route source for equally specific routesStatic AD 1 beats OSPF AD 110
Protocol metricPath quality within the selected route sourceLower OSPF cost wins
Equal-cost forwarding eligibilityWhether equivalent paths can be installed and used togetherMultiple equal-cost paths may use ECMP

Longest-prefix match is the first relevant rule. It selects the most specific matching destination prefix. A more-specific route can win even when its administrative distance is higher.

For example, suppose a router has a default route 0.0.0.0/0 with AD 1 and a route to 203.0.113.0/24 with AD 110. Traffic destined for 203.0.113.10 uses the /24 route because /24 is more specific than /0. Administrative distance does not override longest-prefix matching.

When multiple equally specific candidates remain, the router compares administrative distance. If candidates are from the same protocol, the protocol metric then selects the best path. When multiple eligible paths have equivalent preference and metric, the router may use equal-cost multipath (ECMP), which forwards traffic over more than one path when supported.

Common Cisco IOS Administrative Distance Values

The following values are common defaults in Cisco IOS-based CCNA contexts. They apply to the route-source types shown, not to every possible feature or platform variation.

Route sourceDefault administrative distanceNotes
Connected0Created by an operational interface with an assigned address
Static1Normal manually configured route
External BGP20Route learned from an external BGP peer
EIGRP summary5Summary route generated by EIGRP
Internal EIGRP90Route learned within an EIGRP autonomous system
OSPF110Route learned through OSPF
IS-IS115Route learned through IS-IS
RIP120Route learned through RIP
External EIGRP170Route redistributed into EIGRP from another source
Internal BGP200Route learned from an internal BGP peer
Unknown or untrusted source255Unusable as a normal route; commonly treated as an administrative rejection value

A connected route has AD 0 because the router directly knows the network through an operational interface. Cisco routing tables can also show local host routes created for interface addresses. These local routes have special handling and should not be confused with ordinary connected or dynamic route choices.

Practical Administrative-Distance Examples

Static Route Versus OSPF

A router has equally specific routes to 10.20.0.0/16:

  • A normal static route with AD 1
  • An OSPF route with AD 110

The static route is installed because its lower administrative distance is preferred. This result is independent of the OSPF cost unless the static route is removed or made less preferred.

OSPF Versus RIP

If the same /24 prefix is learned through OSPF and RIP, OSPF wins by default because its AD is 110 and RIP's AD is 120. The RIP hop count does not compete directly with the OSPF cost. The route source is ranked first.

Two OSPF Paths

If two routes to the same prefix are learned through OSPF, both normally have AD 110. OSPF then compares its own cost. The path with the lower OSPF cost is preferred. If the costs are equal and other requirements are met, the routes may be used through ECMP.

More-Specific Route Wins

A router has a default route with AD 1 and a more-specific route with AD 200. Traffic matching the more-specific prefix uses the AD 200 route because prefix length is evaluated before AD. The default route is used only when no more-specific matching route exists.

Local Policy Difference

Administrative distance is local. Two routers can learn the same prefixes but use different tuned AD values. Router A might prefer OSPF, while Router B might prefer a static or another dynamic source. The routers do not automatically learn each other's local AD decisions.

Static Route Administrative Distance

A normal IPv4 or IPv6 static route has a default administrative distance of 1. A static route can therefore override an equally specific route learned from OSPF, RIP, or EIGRP unless its distance is deliberately increased.

A floating static route is a backup static route configured with a higher AD than the preferred route. It remains out of the installed routing table while the preferred route is valid. If the preferred route disappears, the floating static route can be installed.

For example, OSPF normally has AD 110. A backup static route can use AD 같은 120 or another value higher than 110:

Router(config)# ip route 10.30.0.0 255.255.0.0 192.0.2.2 120

The equivalent IPv6 form is:

Router(config)# ipv6 route 2001:db8:30::/48 2001:db8:2::2 120

While the OSPF route to the same prefix is installed, the static route floats. After OSPF withdraws the route and the static next hop remains usable, the static route can take over. Common uses include backup WAN links, an alternate provider, a secondary VPN path, or a disaster-recovery link.

A static route with an unexpectedly low distance can override dynamically learned information and may create a routing black hole or an unintended path. Always check both the prefix length and configured distance.

Viewing and Interpreting Routing-Table Information

The routing table is the installed list of routes used to determine where traffic should go. The Routing Information Base (RIB) is the route database from which the router selects usable routes. The selected information is then placed into the Forwarding Information Base (FIB), a forwarding-oriented structure used for packet forwarding.

Use these commands to inspect IPv4 and IPv6 routes:

Router# show ip route
Router# show ip route 10.30.0.0 255.255.0.0
Router# show ipv6 route
Router# show ipv6 route 2001:db8:30::/48

A typical IPv4 entry can look like this:

O    10.30.0.0/16 [110/20] via 192.0.2.2, 00:12:41, GigabitEthernet0/0
  • O is the route code identifying OSPF as the source.
  • 10.30.0.0/16 is the destination prefix.
  • [110/20] shows administrative distance first and metric second.
  • via 192.0.2.2 identifies the next-hop address.
  • 00:12:41 is the route age or time since the route was learned or refreshed.
  • GigabitEthernet0/0 is the outgoing interface.

Route codes vary by platform and protocol, but common examples include C for connected, L for local, S for static, O for OSPF, D for EIGRP, R for RIP, and B for BGP. Read the code together with the bracketed AD/metric pair.

Protocol-specific commands help verify why a route is or is not available:

Router# show ip protocols
Router# show ip ospf database
Router# show ip eigrp topology
Router# show ip rip database

The routing table shows the selected result. Protocol databases and protocol status show the learned alternatives, neighbors, timers, and protocol-specific metrics that led to that result.

Configuring Static-Route Distance

Specify the distance as the final argument of a static-route command. Without that argument, the normal default is used.

Router(config)# ip route <destination-network> <subnet-mask> <next-hop-address>
Router(config)# ip route <destination-network> <subnet-mask> <next-hop-address> <administrative-distance>

Router(config)# ipv6 route <destination-prefix>/<prefix-length> <next-hop-address>
Router(config)# ipv6 route <destination-prefix>/<prefix-length> <next-hop-address> <administrative-distance>

Use the first form for a normal static route and the second form for a floating or otherwise deliberately tuned static route. Verify the result with show ip route or show ipv6 route.

Tuning Route-Source Distance

Administrative distance can also be changed at the routing-protocol level or, on supported platforms, for selected route sources. The exact command placement and supported syntax vary by protocol and Cisco IOS platform.

Router(config-router)# distance <administrative-distance>
Router(config-router)# distance <administrative-distance> <source-address> <wildcard-mask> <access-list-number>

Use protocol-specific documentation before applying these commands in production. A distance change changes route preference; it does not change the protocol's underlying metric or automatically change what the protocol advertises.

Document every nondefault distance and verify the effect on all relevant routers. Poorly planned tuning can cause:

  • Route feedback, where information returns through a path that originally supplied it
  • Asymmetric routing, where forward and reverse traffic use different paths
  • Accidental route suppression
  • Unexpected failover or failure to fail over
  • Different routers preferring inconsistent paths

Troubleshooting Administrative Distance

Static Route Selected Instead of OSPF

Check whether the static route has its normal AD of 1. Also verify whether the OSPF route is present and valid and whether both routes have the same prefix length.

Router# show ip route <network> <mask>
Router# show ip ospf neighbor
Router# show ip protocols

If the static route is intended only as a backup, increase its AD above the primary OSPF route and verify the next hop.

Floating Static Route Never Takes Over

Possible causes include a primary route that is still installed, an invalid static next hop, a less-specific backup prefix, or an AD that does not make the static route a valid backup.

  1. Inspect the route table before and after a controlled failure.
  2. Confirm that the primary route is removed rather than merely experiencing an application failure.
  3. Validate next-hop reachability and the outgoing interface.
  4. Confirm that primary and backup prefixes have equal specificity.
  5. Review the configured static-route distance.

A Route with a Better Metric Is Not Selected

The competing route may come from a source with a lower AD. The routes may also have different prefix lengths, or the metrics may belong to different protocols and therefore not be directly comparable. Identify the source, prefix length, AD, and protocol-specific metric before drawing a conclusion.

Unexpected Path After Distance Tuning

Review the running configuration for distance commands, compare routing tables on every relevant router, and trace forwarding in both directions. Inconsistent local policies can produce asymmetric routing even when every router has a valid route.

Scope and Limitations

  • AD ranks route sources on one router; it does not determine whether a route is advertised to neighbors.
  • AD does not replace a routing protocol's metric.
  • AD does not override longest-prefix matching.
  • AD is not a value exchanged between routing neighbors.
  • Separate routers can make different choices because AD is locally configured.
  • An AD of 255 represents an unusable or untrusted route in common Cisco contexts.

CCNA Review Checklist

  • Define AD as a local trust ranking for route sources.
  • Remember: lower AD is preferred.
  • Apply longest-prefix match before comparing AD.
  • Compare AD before comparing metrics between different route sources.
  • Use the protocol metric to choose among paths from the same protocol.
  • Know the common Cisco defaults: connected 0, static 1, eBGP 20, EIGRP summary 5, internal EIGRP 90, OSPF 110, IS-IS 115, RIP 120, external EIGRP 170, iBGP 200, and unknown 255.
  • Recognize the bracket format [administrative-distance/metric].
  • Use a higher-distance floating static route for backup operation.
  • Verify nondefault distance changes and document their intended effect.