In IP routing Administrative Distance (AD) is a measure of the trustworthiness and reliability used by routers to determine source of the routing information. Administrative Distance has only local significance and is not advertised in routing updates. It's a value assigned to different routing protocols, static routes and directly connected routes to indicating their reliability.
When a router receives routing information from multiple sources about the same destination network, it compares the Administrative Distance to decide which route to select. The route with the lowest Administrative Distance is preferred because it's considered the most reliable.
Administrative Distances can range from 0 to 255, with lower values indicating routes that are more trustworthy or preferred by the router. However, it's important to note that not all values within this range are commonly used or standardized.
Here are some common default Administrative Distances:
Connected interface 0
Static route 1
Enhanced Interior Gateway Routing Protocol (EIGRP) summary route 5
External Border Gateway Protocol (BGP) 20
Internal EIGRP 90
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
So, if a router receives routing information about a network from both OSPF (AD value- 110) and RIP (AD value- 120), it will prefer the OSPF route because it has a lower Administrative Distance.
Administrative Distance is an important concept in routing because it helps routers to make decisions about which routes to use when building their routing tables.