
A route with a lower administrative distance can still carry none of the traffic you are testing. On a Cisco router, administrative distance helps choose between eligible routes to the same prefix. When forwarding a packet, the router looks for the most specific installed prefix that matches its destination.
Example 1: OSPF and iBGP advertise the same /24
Suppose both protocols offer an eligible route to 192.0.2.0/24. With default Cisco administrative distances, OSPF (110) is preferred over internal BGP (200). Both candidates have exactly the same prefix and length. If the OSPF route is withdrawn, the iBGP route can be installed if it remains eligible and its next hop is reachable.
Example 2: The iBGP route is more specific
Now suppose OSPF provides 192.0.2.0/24 and iBGP provides 192.0.2.128/25. Both can be installed. Traffic to 192.0.2.150 matches the /25, and traffic to 192.0.2.50 matches the /24. The forwarding decision uses prefix length.
Example 3: The default route is the fallback
Suppose the table has a static 0.0.0.0/0 and an OSPF route to 192.0.2.0/24. The /24 handles traffic to 192.0.2.50. A destination outside that /24 uses the default only when there is no other matching, more-specific route.
Verify the decision in a lab
On Cisco IOS or IOS XE, compare the lookups for the two destination addresses below. Confirm the routing table or VRF you are inspecting and the next hop shown for each lookup. If an expected prefix is absent, check whether the protocol learned it and whether its next hop can be resolved. The examples use documentation addresses and illustrative routes.
show ip route 192.0.2.50
show ip route 192.0.2.150For the wider protocol comparison, read OSPF vs BGP: when to use each. Cisco also explains the defaults in its administrative distance guide.

0 Comments