Administrative Distance (AD) is a metric used by routers to determine the trustworthiness of a routing protocol when multiple protocols provide routes to the same destination. It acts as a priority system, where a lower AD value indicates a more preferred route. AD is crucial in scenarios where a router receives multiple routing updates for the same destination from different protocols.
Key Points about Administrative Distance
- Range: AD values typically range from 0 to 255.
- Lower is Better: A route with a lower AD is preferred.
- Default Values: Each routing protocol has a default AD assigned by Cisco (or other vendors).
- Tiebreaker: If multiple routes have the same AD, the router uses other metrics (e.g., metric or cost) to decide.
- Manually Configurable: AD can be modified to influence route selection.
Default Administrative Distance Values (Cisco)
Here are some common default AD values for routing protocols:
Source/Protocol | Administrative Distance |
---|---|
Connected Interface | 0 |
Static Route | 1 |
EIGRP (Enhanced Interior Gateway Routing Protocol) | 90 |
OSPF (Open Shortest Path First) | 110 |
RIP (Routing Information Protocol) | 120 |
External BGP (eBGP) | 20 |
Internal BGP (iBGP) | 200 |
Unknown/Invalid Route | 255 (Ignored) |
How Administrative Distance Works
When a router learns about a destination network from multiple routing protocols, it:
- Compares the AD of each protocol.
- Selects the route with the lowest AD.
- Adds that route to the routing table.
- If ADs are equal (e.g., two static routes), the router uses protocol-specific metrics (e.g., OSPF cost or RIP hop count) or load-balances if configured.
Examples of Administrative Distance in Action
Example 1: Choosing Between OSPF and RIP
Scenario:
- A router learns about the network
192.168.1.0/24
from two protocols: - OSPF: AD = 110, metric = 100
- RIP: AD = 120, hop count = 2
- Decision:
- The router compares the AD values: OSPF (110) is lower than RIP (120).
- The OSPF route is selected and added to the routing table, regardless of RIP’s hop count.
- Routing Table Output:
O 192.168.1.0/24 [110/100] via <next-hop>, <interface>
(The O
indicates an OSPF route, [110/100]
shows AD/metric.)
Example 2: Static Route vs. EIGRP
Scenario:
- A router learns about
10.0.0.0/24
from: - Static Route: AD = 1, points to next-hop
192.168.2.1
- EIGRP: AD = 90, metric = 28160
- Decision:
- The static route has a lower AD (1) than EIGRP (90).
- The static route is chosen, even though EIGRP is a dynamic protocol with more detailed metrics.
- Routing Table Output:
S 10.0.0.0/24 [1/0] via 192.168.2.1
(The S
indicates a static route.)
Example 3: Connected Interface vs. All Others
Scenario:
- A router has an interface directly connected to
172.16.1.0/24
(AD = 0). - It also learns about
172.16.1.0/24
via: - OSPF: AD = 110
- Static Route: AD = 1
- Decision:
- The connected interface has the lowest AD (0).
- The connected route is always preferred over any learned route.
- Routing Table Output:
C 172.16.1.0/24 is directly connected, <interface>
(The C
indicates a connected route.)
Example 4: Modifying Administrative Distance
Scenario:
- A router learns
192.168.3.0/24
from: - RIP: AD = 120
- OSPF: AD = 110
- By default, OSPF’s route is preferred (AD = 110 < 120).
- Change Requirement: Network admin wants to prefer RIP over OSPF.
- Action: The admin modifies OSPF’s AD to 130 for this route using a router configuration command (e.g., in Cisco IOS):
router ospf 1
distance 130
- New Decision:
- Now, RIP (AD = 120) has a lower AD than OSPF (AD = 130).
- The RIP route is selected.
- Routing Table Output:
R 192.168.3.0/24 [120/1] via <next-hop>, <interface>
(The R
indicates a RIP route.)
Example 5: Same AD, Different Metrics
Scenario:
- A router has two static routes to
192.168.4.0/24
: - Static Route 1: AD = 1, next-hop
10.1.1.1
- Static Route 2: AD = 1, next-hop
10.1.1.2
- Decision:
- Both routes have the same AD (1).
- Since static routes don’t have metrics like dynamic protocols, the router either:
- Picks one arbitrarily (based on implementation).
- Load-balances if equal-cost load balancing is enabled.
- Routing Table Output (with load balancing):
S 192.168.4.0/24 [1/0] via 10.1.1.1
[1/0] via 10.1.1.2
Practical Use Cases
- Backup Routes: Use a higher AD for a backup route (e.g., a static route with AD = 200) to ensure it’s only used if the primary route (e.g., OSPF, AD = 110) fails.
- Route Filtering: Adjust AD to prefer routes from a specific protocol in a multi-protocol environment.
- Policy-Based Routing: Modify AD to enforce organizational routing policies.
Notes
- Vendor-Specific: AD values are standardized in Cisco but may vary slightly in other vendors (e.g., Juniper, Arista).
- Verification: Use commands like
show ip route
(Cisco IOS) to check which routes are selected and their AD values. - Floating Static Routes: A static route with a higher AD can act as a backup if the primary route is withdrawn.
Summary
Administrative Distance is a simple yet powerful mechanism to prioritize routing information. By understanding and manipulating AD, network administrators can control which routes are preferred, ensuring optimal traffic flow. Always consider the default AD values and how they interact in multi-protocol environments, and use tools like show ip route
to troubleshoot routing decisions.
If you’d like a deeper dive into configuring AD on specific platforms (e.g., Cisco IOS) or more complex scenarios, let me know!