Network Engineering, November 2020

Administrative Distance, a Cross Vendor Reference

When two protocols offer a route to the same prefix, the metrics cannot be compared, because a cost of ten in one protocol means nothing in another. Administrative distance is the tie break that resolves it.

Two properties are worth fixing in mind immediately. It is entirely local to the router, since it is never advertised and never carried in any packet. And a lower value wins, which is the opposite of how most people first read it.

Cisco defaults

SourceDistance
Connected interface0
Static route1
EIGRP summary5
External BGP20
Internal EIGRP90
OSPF110
IS-IS115
RIP120
External EIGRP170
Internal BGP200
Unusable255

The two BGP values are the interesting pair. External is trusted above every interior protocol at twenty, on the reasoning that a route learned from another autonomous system describes reachability the interior protocol cannot know about.

Internal sits at two hundred, below everything, because a route learned from an internal peer has already been learned from outside by some other router in the domain, and the interior protocol is the better authority on how to reach that router.

The value is not portable

SourceCiscoJuniperNokia SR OSHuawei
Term usedDistancePreferencePreferencePreference
Connected0000
Static15560
OSPF internal110101010
IS-IS level one115151515
OSPF external110150150150
BGP20 or 200170170255

Three differences matter in practice. Juniper and Nokia separate internal from external OSPF where Cisco does not, so a route redistributed into OSPF loses to an internal one automatically rather than requiring configuration.

Neither distinguishes external from internal BGP, giving both the same value, which means the selection between them happens inside the BGP process rather than at this layer. And Huawei places static routes at sixty rather than near zero, which is the single most surprising value on the table for anyone arriving from a Cisco background.

Where changing it is legitimate

A floating static route is the common and correct use. Configuring a static route with a distance higher than the dynamic protocol means it stays out of the table until the protocol withdraws the route, at which point it takes over. This is how backup paths over a secondary link are built without any protocol running across it.

Migration is the other. Raising the distance of the outgoing protocol while both run allows the new one to take over prefix by prefix, with the old one still present and immediately available if something is wrong.

Where changing it causes trouble

Because the value is local, changing it on one router and not another produces a routing table that differs between devices in the same domain, which is how forwarding loops are created between two routers that each believe the other is the better path.

The rule is that any change must be applied consistently across every device that could select between the same two sources, and that the reason must be recorded somewhere, since a non default value discovered years later is indistinguishable from a mistake.

Note: distance decides which route is installed, not which is best. A route with a poor metric from a trusted source beats an excellent metric from a less trusted one, and no comparison of the metrics ever takes place.