Useful Articles

25/recent/ticker-posts

Administrative Distance of IP Routing Protocols - Cisco

Administrative Distance of IP Routing Protocols - Cisco

Administrative Distance (AD) is an 8 bit value/number (Cisco) that defines trustworthiness of a route. AD has only local significance, and is not advertised in routing updates. Smaller the AD value of route/prefix, more preferred it is.


Below is chart of AD values of protocols with respect to Cisco.

Administrative Distance

If a router receives two updates listing the same remote network, the first thing the router checks is the AD. If one of the advertised routes has a lower AD than the other, then the route with the lowest AD will be chosen and placed in the routing table.

Example: Routers R2, R3, and R4 advertise prefix 5.5.5.5/32 to router R1 through protocols OSPF, EIGRP, and RIP respectively.  Router R1, who is running three protocols (OSPF, EIGRP, and RIP) will install the route in the routing table only via EIGRP because it has least AD value (90) compared of OSPF(110) and RIPv2(120).

AD

R1#show ip protocols summary
Index Process Name
0     connected
1     static
2     ospf 1
3     rip
4     eigrp 10


R1#sh ip route 5.5.5.5
Routing entry for 5.5.5.5/32
  Known via "eigrp 10", distance 90, metric 158720, type internal
  Redistributing via eigrp 10
  Last update from 10.10.13.3 on FastEthernet1/1, 00:19:00 ago
  Routing Descriptor Blocks:
  * 10.10.13.3, from 10.10.13.3, 00:19:00 ago, via FastEthernet1/1
      Route metric is 158720, traffic share count is 1
      Total delay is 5200 microseconds, minimum bandwidth is 100000 Kbit
      Reliability 255/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 2

R1#sh ip route
      5.0.0.0/32 is subnetted, 1 subnets
D        5.5.5.5 [90/158720] via 10.10.13.3, 00:27:39, FastEthernet1/1


However, on R1, if we shut interface F1/1, the best route for prefix will now be learned via OSPF. Likewise, if we shut both interfaces F1/0 and F1/1, we can see that route will be learned via RIP.

Other useful commands:

R1#sh ip protocols
*** IP Routing is NSF aware ***

Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 10.10.12.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
  Routing on Interfaces Configured Explicitly (Area 0):
    FastEthernet1/0
  Routing Information Sources:
    Gateway         Distance      Last Update
    5.5.5.5                 110          00:41:29
    10.10.14.4           110          00:42:47
    10.10.12.2           110          00:28:38
    10.10.13.3           110          00:46:26
  Distance: (default is 110)

Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 18 seconds
    Gateway         Distance      Last Update
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface             Send  Recv  Triggered RIP  Key-chain
    FastEthernet1/0       2     2
    FastEthernet1/1       2     2
    FastEthernet2/0       2     2
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    10.0.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.10.14.4           120      00:00:08
  Distance: (default is 120)

Routing Protocol is "eigrp 10"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  Redistributing: eigrp 10
    Gateway         Distance      Last Update
  EIGRP-IPv4 Protocol for AS(10)
    Metric weight K1=1, K2=0, K3=1, K4=0, K5=0
    NSF-aware route hold timer is 240
    Router-ID: 10.10.14.1
    Topology : 0 (base)
      Active Timer: 3 min
      Distance: internal 90 external 170
      Maximum path: 4
      Maximum hopcount 100
      Maximum metric variance 1

  Automatic Summarization: disabled
  Maximum path: 4
  Routing for Networks:
    10.0.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.10.13.3            90      00:28:52
  Distance: internal 90 external 170


Changing the default AD value

You can modify the administrative distance of a protocol through the distance command in the router configuration mode. For example, if we want to prefer route of prefix 5.5.5.5/32 via RIP we can do that by changing the default AD value of RIP to 80 as shown below:

R1#conf t
R1(config)#router rip
R1(config-router)#distance 80
R1(config-router)#

We can see that the route for prefix 5.5.5.5/32 is now learned via RIP whose AD value is 80 (less than EIGRP's AD 90).

R1#sh ip route 5.5.5.5
Routing entry for 5.5.5.5/32
  Known via "rip", distance 80, metric 2
  Redistributing via rip
  Last update from 10.10.14.4 on FastEthernet2/0, 00:00:27 ago
  Routing Descriptor Blocks:
  * 10.10.14.4, from 10.10.14.4, 00:00:27 ago, via FastEthernet2/0
      Route metric is 2, traffic share count is 1

Similarly, you can change  the default AD values of other protocols too.

Other Applications of Administrative Distance

One of the common reasons to change the AD of a route is when you use Static Routes to backup and existing IGP route. This is normally used to bring up a backup link when the primary fails.

For example, assume there is 4th low speed ISDN link on R1 to reach R5. We can use floating static route with AD 150 (a higher AD value compared to EIGRP, OSPF, and RIP)

R1(config)#ip route 5.5.5.5 255.255.255.255.255  Dialer 1   150  

For more details, kindly refer the article Using Floating Static Routes and Dial-on-Demand Routing

 Another important thing to understand is that AD values for various protocols may vary from vendor to vendor. For example, in JunOS, RIP has an AD value of 100. AD values for various protocols in JunOS. For more details, kindly refer the article Understanding Administrative Distance Values - JunOS


If you have understood the concept of AD and liked reading this article, kindly share this article with others.

Post a Comment

0 Comments