Administrative Distance (AD) – Detailed Explanation
Definition of Administrative Distance
Administrative Distance (AD) is a numeric value that ranks the trustworthiness of routing sources. It helps routers select the most reliable route when multiple routing sources are available.
Purpose of AD in Routing Decisions
AD acts as a tiebreaker between different routing protocols offering paths to the same destination. The route with the lowest AD is selected for the routing table.
Default AD Values for Common Routing Protocols
Route Source | Administrative Distance |
---|---|
Connected | 0 |
Static Route | 1 |
eBGP | 20 |
EIGRP (internal) | 90 |
OSPF | 110 |
RIP | 120 |
EIGRP (external) | 170 |
iBGP | 200 |
How AD Affects Route Selection
If a router receives multiple routes for the same destination, it chooses the one with the lowest AD. If multiple routes have the same AD, the protocol's metric is used next.
Example
Destination 192.168.1.0/24 is learned from:
- OSPF (AD 110, metric 100)
- RIP (AD 120, metric 2)
OSPF is selected because of its lower AD.
Difference Between AD and Metric
- AD: Compares trust across different protocols (lower is better)
- Metric: Compares routes within the same protocol
Example
Two OSPF routes with same AD (110):
- Route 1: metric 100
- Route 2: metric 50
Route 2 is selected due to lower metric.
Modifying AD (e.g., Static Routes)
Router(config)# ip route 192.168.1.0 255.255.255.0 10.0.0.1 150
This makes the static route less preferred than OSPF (AD 110).
Floating Static Routes
Used as backup paths when the main dynamic route fails.
Router(config)# ip route 192.168.1.0 255.255.255.0 10.0.0.2 130
Verifying AD in Routing Tables
Router# show ip route
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0
S 10.0.0.0/24 [1/0] via 192.168.2.1
O 172.16.0.0/16 [110/65] via 192.168.3.1, 00:02:34, Serial0/0/0
D 192.168.4.0/24 [90/2172416] via 192.168.5.1, 00:01:23, FastEthernet0/0
Troubleshooting Conflicting Routes
Router# show ip protocols
Router(config)# router ospf 1
Router(config-router)# no distance 130
AD in Multi-Protocol Environments
Router(config)# router eigrp 100
Router(config-router)# distance eigrp 120 170
Impact of Misconfigured AD
Can result in suboptimal routing, loops, traffic drops, or premature failover. Always test and document AD changes.
Temporary vs. Permanent AD Changes
- Temporary: Lost after reboot (unless saved)
- Permanent: Use
write memory
to retain
Best Practices
- Document changes
- Use floating static routes appropriately
- Test in lab or during maintenance
- Verify changes with
show ip route
- Keep AD values consistent across routers
Vendor-Specific AD Behavior
Vendor | Routing Preference Type | OSPF Default | Static Default |
---|---|---|---|
Cisco | Administrative Distance | 110 | 1 |
Juniper | Route Preference | 10 (internal), 150 (external) | 5 |
Huawei | Preference | 10 | 60 |
Juniper Example
set protocols ospf preference 50
Practical Example
Router(config)# router eigrp 100
Router(config-router)# distance eigrp 120 170
Router(config)# ip route 192.168.1.0 255.255.255.0 10.0.0.2 130
Router# show ip route