A routing table gets routes in three ways:
- Directly connected networks
- Statically configured routes
- Routing protocols (RIP, EIGRP, IS-IS, OSPF, BGP, etc.)
It is possible that the routing process could receive multiple routes to the same destination from separate sources. The routing process must decide which of the possible routes to a destination to use. The first thing it looks at is the length of the mask, and the route to a destination with the longest mask wins. If there are still multiple routes of the same length, it needs a tie-breaker. Cisco call this AD (Administrative Distance), which is really how trusted the source of the route is. For instance, a directly connected network is the most trusted, and it will be used. There are tables, e.g. What Is Administrative Distance?
Select the Best Path
Administrative distance is the first criterion that a router uses to determine which routing protocol to use if two protocols provide route
information for the same destination. Administrative distance is a
measure of the trustworthiness of the source of the routing
information. Administrative distance has only local significance, and
is not advertised in routing updates.
Note: The smaller the administrative distance value, the more reliable the protocol. For example, if a router receives a route to a
certain network from both Open Shortest Path First (OSPF) (default
administrative distance - 110) and Interior Gateway Routing Protocol
(IGRP) (default administrative distance - 100), the router chooses
IGRP because IGRP is more reliable. This means the router adds the
IGRP version of the route to the routing table.
If you lose the source of the IGRP-derived information (for example,
due to a power shutdown), the software uses the OSPF-derived
information until the IGRP-derived information reappears.
Default Distance Value Table
This table lists the administrative distance default values of the protocols that Cisco supports:
- If the administrative distance is 255, the router does not believe the source of that route and does not install the route in the routing