Describe administrative distance

Exam: Cisco 300-101 - CCNP Implementing Cisco IP Routing (ROUTE v2.0)


Administrative distance is one of the features used by routers to select the best path to send the packets to a destination when multiple protocols report different paths to the same destination. The other features used by routers to find the best path to a destination include ‘longest prefix length’ and ’metrics’.

The routes with longest prefix length are preferred by routers regardless of the protocols when multiple routes with different prefix lengths exist in the routing table. For example, consider the following prefixes exist in the routing table:

10.11.1.0/20
10.11.1.0/25
10.11.1.0/28

A packet for destination 10.11.1.1 appears to the router. The packet can be sent to any of the paths defined in the routing table because it belongs to all the subnets defined. In such a scenario, router would choose 10.11.1.0/28 subnet because this subnet has the longest prefix length and therefore is the longest match for the packet.

Matrix is used by routers to calculate the best path in case when the multiple routes available in the routing table suggested by the same protocol have the same prefix length. Each routing protocol provides a matrix for the suggested path, which is calculated on the basis of their own internal calculations that include parameters such as distance, speed, and hops.

Administrative distance

Just like ‘longest prefix length’ and ’metrics’, the Administrative distance also help routers in selecting the best path. The administrative distance is used to calculate the best path when the routes suggested by multiple protocols for the same destination has the same prefix length. The administrative distance value of each routing protocol is different. So the selection of the route depends upon the protocol that consists of lowest administrative distance value.

Administrative distance suggests the trustworthiness of a routing protocol. Each routing protocol has a specific administrative distance value by default. However, the administrative distance value of a routing protocol can be adjusted manually to control the precedence of a protocol with other protocols.

The administrative distance values of some commonly used protocols are:

Protocol Administrative Distance
Connected 0
Static 1
eBGP 20
EIGRP internal 90
IGRP 100
OSPF 110
IS-IS 115
RIP 120
EIGRP external 170
iBGP 200
Unknown* 255

The lower the administrative distance value, the most preferred the path is. The lowest administrative distance value is 0 and the highest is 255. The value 0 suggests the directly connected routes and are most preferred and the value 255 suggests the most untrusted route. Such untrusted routes are ignored by the router and are not installed in the routing table.

Consider a router table consists of the following routes for a destination.

10.11.1.0/25BGP
10.11.1.0/25OSPF
10.11.1.0/25 Static

In such a scenario, the router will select the static route over the BGP and OSPF routes because the static route has the lowest administrative distance.

The administrative distance is local for each router and therefore each router can have a different administrative distance values when they are modified for the preference of a routing protocol.

The routing protocol precedence is usually defined when route redistribution is used during network migration from one network to another. You can define route precedence using ‘distance’ command. For example, if you want to use RIP routes that have the default administrative distance value of 120 over IGRP routes that have default administrative value of 100 then you need to either reduce the administrative distance value of RIP protocol or increase the value of IGRP protocol.

While changing administrative distance values for routing protocols, you need to be cautious because changing administrative distance values may result in the creation of routing loops and black holes.

Let us try changing the administrative distance values. Consider there are two routers RouterA and RouterB. The routers are connected over Ethernet and advertise the loopback interfaces using RIP and IGRP routes

The show IP route command displays routing table. You can notice that the IGRP routes are preferred over the RIP routes in the routing table since the administrative distance is 100.

RouterA#show ip route

Gateway of last resort is not set

172.168.0.0/24 is subnetted, 1 subnets

C 172.168.1.0 is directly connected, Ethernet0

I 10.0.0.0/8 [100/1600] via 172.16.1.200, 00:00:01, Ethernet0

C 192.168.1.0/24 is directly connected, Loopback0

RouterB#show ip route

Gateway of last resort is not set

172.168.0.0/24 is subnetted, 1 subnets

C 172.168.1.0 is directly connected, Ethernet0

C 10.0.0.0/8 is directly connected, Loopback0

I 192.168.1.0/24 [100/1600] via 172.16.1.100, 00:00:33,

Now configure RouterA to prefer RIP routes to IGRP by reducing the administrative distance value of RIP.

RouterA(config)# router rip

RouterA(config-router)# distance 90

Notice the administrative distance is changed from the default value of 120 to 90 for RIP routes in routing table of RouterA. The routing table of RouterA now shows the preference of RIP routes over IGRP routes.

Also note that the changed administrative distance value is applicable only to RouterA. The other router RouterB still shows the default route values of RIP and IGRP routes in its routing table.

RouterA#show ip route

Gateway of last resort is not set

172.168.0.0/24 is subnetted, 1 subnets

C 172.168.1.0 is directly connected, Ethernet0

R 10.0.0.0/8 [90/1] via 172.16.1.200, 00:00:16, Ethernet0

C 192.168.1.0/24 is directly connected, Loopback0

RouterB#show ip route

Gateway of last resort is not set

172.168.0.0/24 is subnetted, 1 subnets

C 172.168.1.0 is directly connected, Ethernet0

C 10.0.0.0/8 is directly connected, Loopback0

I 192.168.1.0/24 [100/1600] via 172.16.1.100, 00:00:33,

Exam Question

Under which of the following conditions does a router use the administrative distance to select the best path to the destination?

  1. A router uses the administrative distance to select the best path to the destination when multiple routes with different prefix lengths exist in the routing table
  2. A router uses the administrative distance to select the best path to the destination when the multiple routes available in the routing table suggested by the same protocol have the same prefix length.
  3. A router uses the administrative distance to select the best path to the destination when multiple protocols report different paths to the same destination.
  4. A router does not use administrative distance to select a best path for a destination.

Answer: 4

Just like ‘longest prefix length’ and ’metrics’, the Administrative distance also help routers in selecting the best path. The administrative distance is used to calculate the best path when the routes suggested by multiple protocols for the same destination has the same prefix length. The administrative distance value of each routing protocol is different. So the selection of the route depends upon the protocol that consists of lowest administrative distance value.

The routes with longest prefix length are preferred by routers regardless of the protocols when multiple routes with different prefix lengths exist in the routing table.

Matrix is used by routers to calculate the best path in case when the multiple routes available in the routing table suggested by the same protocol have the same prefix length. Each routing protocol provides a matrix for the suggested path, which is calculated on the basis of their own internal calculations that include parameters such as distance, speed, and hops.


Related IT Guides

  1. Configure and verify default routing
  2. Configure and verify IPv4 and IPv6 DHCP
  3. Configure and Verify network types, area types, and router types
  4. Configure and Verify RIPv2
  5. Configure and verify static routing
  6. Describe device security using IOS AAA with TACACS+ and RADIUS
  7. Describe DMVPN (single hub)
  8. Describe IPv6 NAT
  9. Describe, configure, and verify BGP peer relationships and authentication
  10. Explain BGP attributes and best-path selection
  11. Explain Frame Relay
  12. Explain general network challenges
  13. Layer 3 technologies - Describe administrative distance
  14. Use Cisco IOS troubleshooting tools