VMware ESXi and vSphere Cluster Management
Administrative Distance (AD) Explained
Learn how administrative distance ranks route sources, how AD differs from routing metrics, and how routers choose routes between connected, static, EIGRP, OSPF, and RIP sources.
Administrative distance (AD) is a local router value that rates how trustworthy a route source is. When a router learns routes to the same destination from different sources, it uses AD to decide which route is eligible to enter its routing table.
A routing table is the collection of selected routes a router uses to forward packets. A route source is where routing information came from, such as a directly connected interface, a static route, or a routing protocol.
What Administrative Distance Does
Routers can learn the same network through multiple sources. For example, a router might learn a route through RIP and another route through internal EIGRP. Both routes may describe the same destination prefix, but the router normally installs only the preferred candidate in its routing table.
AD provides the comparison across those different route sources. A lower AD means the source is considered more trustworthy. AD is local to the router making the decision; it is not a value that is carried to other routers as part of a route advertisement.
Administrative Distance Values
AD values range from 0 through 255.
- Lower values are preferred. They represent a more trusted route source.
- AD 0 is used for directly connected routes.
- AD 255 means the source is not trusted. A route with AD 255 is not installed in the routing table.
A directly connected route is created when an active router interface is attached to a network. A static route is manually configured. Dynamic routing protocols exchange route information between routers.
Default Administrative Distance Values
The following are common default values:
Internal EIGRP is a route that originated within the same EIGRP autonomous system. External EIGRP is a route redistributed into EIGRP from another source.
These values are compared only after the candidate routes match the same destination prefix and prefix length. AD does not allow a less-specific route to defeat a more-specific route.
Route Selection Order
Routers apply route-selection rules in an important order:
- Longest-prefix match: The router first selects the most specific prefix that matches the packet's destination address.
- Administrative distance: If competing routes have the same destination prefix and prefix length but came from different sources, the router prefers the route with the lowest AD.
- Routing metric: If competing routes came from the same routing protocol and have the same AD, that protocol compares its own metric to select the best path.
The selected route is installed in the routing table and used for forwarding.
Why Longest-Prefix Match Comes First
Suppose a router has a route for 10.0.0.0/8 with AD 90 and a route for 10.0.0.0/24 with AD 120. Traffic for an address in 10.0.0.0/24 follows the /24 route because it is more specific. The lower AD of the /8 route does not override longest-prefix match.
Worked Example: EIGRP Versus RIP
R1 receives advertisements for 10.0.0.0/24 from two neighboring routers:
- R2 advertises
10.0.0.0/24through RIP. - R3 advertises
10.0.0.0/24through internal EIGRP.
Both candidates have the same network prefix and prefix length, so longest-prefix match does not distinguish them. R1 compares their default AD values:
Internal EIGRP has AD 90, which is lower than RIP's AD 120. Therefore, R1 installs the EIGRP-learned route and forwards traffic for 10.0.0.0/24 toward R3.
Administrative Distance Versus Routing Metric
AD and metric are different values used at different stages of route selection.
- Administrative distance compares the trustworthiness of different route sources. For example, it compares a RIP route with an EIGRP route.
- Routing metric compares paths learned through the same routing protocol. Each protocol defines its own metric and calculation.
For RIP, the metric is hop count. For OSPF, the metric is cost. Because different protocols calculate metrics differently, metric values from different protocols must not be compared directly. A RIP metric of 2 is not automatically better than an OSPF cost of 50. AD is considered first when the routes are equal in prefix length and came from different sources.
Additional Examples
Connected Route Versus Static Route
If a router has a directly connected route and a static route for the same destination prefix, the connected route has the lower default AD:
- Connected interface: AD 0
- Static route: AD 1
The connected route is preferred because 0 is lower than 1.
AD 255 and Untrusted Routes
An AD of 255 identifies a route source as untrusted. A route assigned AD 255 is not installed in the routing table, even if the route information is otherwise available.
Scope and Configuration
Administrative distance is a local preference. If two routers receive the same route sources, they can make different decisions if their locally configured AD values differ.
Default AD values can be changed through router configuration. Such changes should be deliberate because they can alter traffic paths, override the normal preference between protocols, and create unexpected routing behavior. Before changing AD, identify the intended primary and backup paths and consider how the change will affect failover.
Troubleshooting Route Selection
Unexpected Path
If a router selects an unexpected path even though another protocol advertises the same network, check the following:
- Confirm that both candidate routes have the same network prefix and prefix length.
- Identify the route source for each candidate.
- Compare the applicable AD values.
- Check whether a nondefault AD has been configured locally.
The likely explanation is that the route source with the lower AD was installed for equal prefixes.
Route Missing from the Routing Table
If a learned route does not appear in the routing table:
- Determine whether a route to the same prefix exists from a source with a lower AD.
- Check whether the route has AD 255.
- Verify that the route is otherwise valid and reachable.
A route may be omitted because a more trusted route is already installed or because its AD makes it unusable.
Metric Misunderstanding
If someone assumes that a smaller metric from one protocol should beat a route from another protocol, first identify the protocols that learned the routes. Apply AD before comparing a protocol metric. Metrics are protocol-specific and are not directly comparable across routing protocols.
Summary
- AD is a local value that ranks the trustworthiness of route sources.
- Values range from 0 to 255, and lower values are preferred.
- Connected routes use AD 0 by default, while unknown routes use AD 255 and are not installed.
- Longest-prefix match is evaluated before AD.
- AD compares different route sources; a routing metric compares paths within the same protocol.
- After route selection, the preferred route is installed in the routing table and used for forwarding.
- Default AD values can be changed locally, but changes should be planned carefully.
For the related lesson, see Administrative Distance (AD) Explained.