What is Administrative Distance?
The administrative distance (AD) is a measure of the trustworthiness of the source of the routing information.
It is used by routers to determine which route to install in the routing table when there are multiple routes to the same destination from different sources.
Routes with a lower AD are installed in preference to those with a higher AD. The administrative distance has a value between 0 and 255, with 0 being the most trusted and 255 being the least trusted.
Each routing protocol has a default AD, as follows:
- Connected interfaces – 0
- Static routes – 1
- Enhanced Interior Gateway Routing Protocol (EIGRP) summary routes – 5
- External Border Gateway Protocol (EBGP) routes – 20
- Internal EIGRP routes – 90
- IGRP – 100
- OSPF – 110
- Intermediate System to Intermediate System (IS-IS) – 115
- Routing Information Protocol (RIP) Version 1 – 120
- EIGRP external routes – 170
- RIP Version 2 – 200
- Unknown – 255
Importance of Administrative Distance
The AD is not universally used by all routers, but it is an important concept to be aware of.
When a router receives multiple updates for the same destination from different sources, it will install the route with the lowest AD in the routing table.
If two routes have the same AD, the router will choose the route that was learned from the most trusted source.
- For example, if a router learns about a route to destination X from both RIP Version 1 and EIGRP, it will prefer the EIGRP route because it has a lower AD.
The AD can be used to manipulate the routing table in order to prefer certain routes over others.
- For example, a static route can be configured with a higher AD than the default in order to prevent it from being installed in the routing table.
This can be useful when troubleshooting routing problems, as it allows you to temporarily disable a route without removing it completely.
The AD is also used by some routing protocols when choosing between equal-cost multi-path routes.
- For example, if EIGRP is configured to load balance over multiple paths and one of the paths is via a static route with a higher AD, EIGRP will prefer the other path because it has a lower AD.
How to Configure AD on Network Devices?
Here are the steps:
1. Use the distance command to configure the AD of a static route:
- Router(config)#route 10.0.0.0 255.255.255.0 10.1.1.1 ?
- <1-255> Distance for this route
- Router(config)#route 10.0.0.0 255.255.255.0 10.1.1.1 2
2. Use the distance EIGRP command to configure the AD of an EIGRP route:
- Router(config-router)#distance EIGRP ?
- <1-255> Administrative distance for this route
- Router(config-router)#distance EIGRP 90 ?
- <1-255> Distance for this route
- Router(config-router)#distance EIGRP 90 2
3. Use the distance OSPF command to configure the AD of an OSPF route:
- Router(config-router)#distance OSPF ?
- <0-255> Distance for this route
- Router(config-router)#distance OSPF 110 2
4. Use the distance BGP command to configure the AD of a BGP route:
- Router(config-router)#distance BGP ?
- <1-255> Administrative distance for this route
- Router(config-router)#distance BGP 20 2