This document describes how Cisco routers use Administrative Distance (AD) to choose the most trusted route source.
Cisco recommends that you have knowledge of basic IP Routing.
This document is not restricted to specific software and hardware versions.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
AD is a value used to rank the trustworthiness of routing information sources. When the routing table receives candidate routes to the same destination prefix from different route sources, the route with the lowest administrative distance is preferred and installed in the routing table.
Most routing protocols have metric structures and algorithms that are not compatible with other protocols. In a network with multiple routing protocols, the exchange of route information and the capability to select the best path across the multiple protocols are critical. Each routing protocol or source is assigned an AD value, which determines its priority when multiple routes to the same destination are available. Lower values are preferred over higher ones.
Before a route can be installed in the routing table, the router performs several checks, such as validating the route, resolving the next hop, and selecting the best route for a given destination prefix. AD is used only when multiple routing sources advertise the same destination prefix.
In general, the Routing Information Base (RIB) installation process has this sequence.
Note: AD and routing metrics are not evaluated during forwarding. Those values have already been used to determine which routes were installed in the RIB, hence AD does not override longest prefix match.
Note: The previous steps describe how routes are selected and installed in the RIB. Once the routes are installed, packet forwarding uses the Forwarding Information Base (FIB), where longest prefix match determines which installed route is used for each packet.
AD is a local value and is not advertised in routing updates. The smaller the administrative distance value, the more preferred the route source.
For example, if a router learns the same prefix from Open Shortest Path First (OSPF) and Enhanced Interior Gateway Routing Protocol (EIGRP), the router prefers the EIGRP route by default because internal EIGRP has an administrative distance of 90, while OSPF has an administrative distance of 110. The RIB installs the EIGRP route because it has the lowest administrative distance for that destination prefix. If the EIGRP route is later withdrawn for example, because the EIGRP neighbor goes down, the router reevaluates the remaining candidate routes. If the OSPF route is still valid and its next hop can be resolved, it is installed in the routing table and becomes the active route for that destination prefix.
In show ip route output, the values in brackets use the format [administrative distance/metric]. For example, [90/1] means the route has an administrative distance of 90 and a protocol metric of 1.
After routes have been installed in the routing table, the router uses longest prefix match to forward packets. When multiple installed routes match the destination IP address, the router selects the route with the most specific prefix. For example, if the routing table contains 192.168.1.0/24 and 192.168.0.0/16, a packet destined for 192.168.1.10 matches both routes, but the router forwards the packet using 192.168.1.0/24 because it is the longest (more specific) prefix.
This table lists the administrative distance default values of the protocols that Cisco supports.
| Route Source | Default AD Values |
|---|---|
| Connected | 0 |
| Static | 1 |
| EIGRP summary route | 5 |
| External Border Gateway Protocol (BGP) | 20 |
| Internal EIGRP | 90 |
| Interior Gateway Routing Protocol (IGRP) | 100 |
| OSPF | 110 |
| Intermediate System-to-Intermediate System (IS-IS) | 115 |
| Routing Information Protocol (RIP) | 120 |
| Exterior Gateway Protocol (EGP) | 140 |
| On Demand Routing (ODR) | 160 |
| External EIGRP | 170 |
| Internal BGP | 200 |
| Unknown* | 255 |
Note: If the administrative distance is 255, the router does not consider the route reliable and does not install it in the routing table.
When a router learns the same destination prefix from more than one routing source, you can modify administrative distance to influence which route is installed in the routing table.
Note: Use caution if you are planning a change to the AD. AD is local to the router, and inconsistent changes across routers can cause asymmetric routing, suboptimal routing, routing loops, or traffic black holes.
For example, internal EIGRP has a default administrative distance of 90, and OSPF has a default administrative distance of 110. If both protocols advertise the same prefix, the router installs the EIGRP route by default because 90 is lower than 110.
To illustrate this behavior, R1 and R2 are directly connected through GigabitEthernet1 in the 172.16.1.0/24 network.
On R1, the route to 10.0.0.0/24 is installed as an EIGRP route. The route code D indicates EIGRP. The values in brackets use the format [administrative distance/metric]. In this example, [90/130816] means that the route has an administrative distance of 90 and an EIGRP metric of 130816. On R2, the route to 192.168.1.0/24 is also installed as an EIGRP route:
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets D 10.0.0.0 [90/130816] via 172.16.1.200, 00:16:10, GigabitEthernet1
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, GigabitEthernet1
L 172.16.1.100/32 is directly connected, GigabitEthernet1
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, Loopback0
L 192.168.1.1/32 is directly connected, Loopback0
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/24 is directly connected, Loopback0
L 10.0.0.1/32 is directly connected, Loopback0
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, GigabitEthernet1
L 172.16.1.200/32 is directly connected, GigabitEthernet1
D 192.168.1.0/24 [90/130816] via 172.16.1.100, 00:13:42, GigabitEthernet1
Although OSPF also learns the same prefix, the OSPF route is not installed in the routing table because its default administrative distance of 110 is higher than the EIGRP administrative distance of 90.
You can modify the administrative distance of routes learned by a routing process with the distance <AD-value> command. In this example, the OSPF administrative distance on R1 is changed to 85:
R1#configure terminal
R1(config)#router ospf 100
R1(config-router)#distance 85
R1(config-router)#end
Caution: The example shows how to modify the AD of a protocol, however, use extreme caution when you change the AD. An inconsistent AD design can cause asymmetric routing, suboptimal routing, routing loops, or traffic black holes. Validate the routing design before and after the change.
After the AD change, R1 prefers the OSPF route to 10.0.0.0/24 because OSPF now has an administrative distance of 85, which is lower than the EIGRP administrative distance of 90.
The route code changes from D to O, which indicates that the OSPF route is now installed in the routing table. The value [85/2] shows an administrative distance of 85 and an OSPF metric of 2.
The administrative distance change has local significance only. It affects route selection on R1, but it is not advertised to R2. Therefore, R2 continues to prefer the EIGRP route to 192.168.1.0/24:
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets O 10.0.0.0 [85/2] via 172.16.1.200, 00:00:11, GigabitEthernet1
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, GigabitEthernet1
L 172.16.1.100/32 is directly connected, GigabitEthernet1
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, Loopback0
L 192.168.1.1/32 is directly connected, Loopback0
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/24 is directly connected, Loopback0
L 10.0.0.1/32 is directly connected, Loopback0
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, GigabitEthernet1
L 172.16.1.200/32 is directly connected, GigabitEthernet1
D 192.168.1.0/24 [90/130816] via 172.16.1.100, 00:20:15, GigabitEthernet1
There are no general guidelines to assign administrative distances because each network has varied requirements. You must determine a reasonable matrix of administrative distances for the network as a whole.
A common use of administrative distance is a floating static route. A floating static route is configured with an administrative distance higher than the primary route, so it is used only when the primary route is removed from the routing table.
In this example, R1 uses OSPF as the primary route source to reach 10.0.0.0/24 through R2. The OSPF route has the default administrative distance of 110.
R1#show ip route ospf
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets O 10.0.0.0 [110/2] via 172.16.1.200, 00:00:09, GigabitEthernet1
Note: The Administrative Distance is set to 250.
The route code O indicates that the route was learned through OSPF. The values in brackets use the format [administrative distance/metric]. In this case, [110/2] means that the route has an administrative distance of 110 and an OSPF metric of 2.
To configure a floating static route for the same destination, use an administrative distance higher than the OSPF administrative distance:
R1#configure terminal
R1(config)#ip route 10.0.0.0 255.255.255.0 172.16.1.200 250
R1(config)#end
In the previous command, 250 is the AD value assigned to the static route. Because 250 is higher than the OSPF AD of 110, the static route is not installed in the routing table while the OSPF route is available.
If the OSPF route is removed from the routing table, the floating static route becomes the best available route to 10.0.0.0/24 and is installed in the routing table:
R1#show ip route ospf
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets S 10.0.0.0 [250/0] via 172.16.1.200
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, GigabitEthernet1
L 172.16.1.100/32 is directly connected, GigabitEthernet1
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, Loopback0
L 192.168.1.1/32 is directly connected, Loopback0
The route code changes to S, which indicates that the static route is now installed. The value [250/0] shows an AD of 250 and a static route metric of 0.
Note: The floating static route is installed only when no route with a lower administrative distance exists for the same prefix. The next hop, 172.16.1.200, must also be reachable. If the next hop cannot be resolved, the static route is not installed.
Note: Use floating static routes carefully. An incorrect next hop, an administrative distance that is too low, or inconsistent backup routing can cause traffic to use the backup path unexpectedly or fail during a primary route outage.
For additional examples on the use of Floating Static routes, refer to these documents:
| Revision | Publish Date | Comments |
|---|---|---|
3.0 |
20-Jul-2026
|
Updated Title, Introduction, and Formatting. |
1.0 |
20-Dec-2001
|
Initial Release |