Routing & Switching

Administrative Distance — Default Values, How It Works and How to Change It

G Gurpreet Singh April 17, 2024 5 min read
Animated diagram for Administrative Distance, showing four routers in a line with a packet travelling hop by hop and a route table lookup highlighting each column in turn

Administrative distance (AD) is how a router decides which source of routing information to trust when more than one offers a path to the same destination. It is a trustworthiness rating from 0 to 255, and lower is more trusted.

If OSPF and EIGRP both learn a route to 10.20.0.0/16, the router does not compare their metrics, the metrics are not comparable, since one counts cost and the other bandwidth and delay. It compares administrative distance. EIGRP’s 90 beats OSPF’s 110, so the EIGRP route is installed in the routing table and the OSPF one is not.

Default Administrative Distance Values (Cisco)

Route sourceAD
Connected interface0
Static route1
EIGRP summary route5
External BGP (eBGP)20
Internal EIGRP90
IGRP100
OSPF110
IS-IS115
RIP120
External EIGRP170
Internal BGP (iBGP)200
Unknown / unreachable255

An AD of 255 means the route is never installed. Setting a route’s AD to 255 is a way of administratively disabling it without deleting it.

The values worth understanding rather than memorising

  • Connected is 0 because the router can see the interface is up. Nothing is more reliable than that.
  • Static is 1 because an administrator typed it deliberately, and that intent outranks any protocol’s calculation.
  • eBGP is 20, iBGP is 200. This asymmetry surprises people. eBGP routes come from another autonomous system and are trusted above any IGP, so they are not overridden by internal protocols. iBGP is deliberately worse than every IGP, because inside your own AS your IGP knows the topology and BGP does not.
  • External EIGRP is 170, not 90, redistributed routes are less trustworthy than routes EIGRP learned natively. Forgetting this causes surprising path selection after redistribution.

Administrative Distance vs Metric

Administrative distanceMetric
ComparesDifferent routing protocolsDifferent paths within one protocol
EvaluatedFirstOnly after AD ties
ScopeLocal to the routerLocal to the router
Based onTrust in the sourceCost, bandwidth, delay, hop count

The router’s decision order for identical prefixes is:

  1. Longest prefix match wins first. A /24 beats a /16 regardless of AD or protocol. This trumps everything else.
  2. Then lowest administrative distance.
  3. Then lowest metric, if the AD is tied, which only happens within the same protocol.
  4. Then load balance across equal-cost paths.

Step 1 is the one people forget. A more specific route from RIP will be used over a less specific route from OSPF, because prefix length is compared before trust.

Administrative Distance Is Local

AD is not carried in any routing update. It exists only in the router evaluating the route. You can set EIGRP to 200 on one router and leave it at 90 everywhere else, and only that one router changes behaviour.

That makes AD a precise tool, and a source of extremely confusing routing loops if applied inconsistently, because two routers can each believe the other is the better next hop.

Changing Administrative Distance

Static routes

Router(config)# ip route 10.20.0.0 255.255.0.0 192.168.1.1 210

The trailing 210 is the AD. This is the floating static route, the most common legitimate use of AD manipulation.

The floating static pattern

You want a backup path that is used only when the primary protocol-learned route disappears:

! Primary: learned via OSPF, AD 110

! Backup: static route via the secondary link, AD 210
Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.2 210

Because 210 is worse than OSPF’s 110, the static route sits inactive. If OSPF loses the route, the static installs itself immediately. When OSPF recovers, it takes over again. Set the AD above the protocol you are backing up, and below 255.

Per-protocol

! OSPF, all routes, or selectively
Router(config-router)# distance 115
Router(config-router)# distance ospf external 130

! EIGRP, internal and external separately
Router(config-router)# distance eigrp 90 170

! BGP, external, internal, local
Router(config-router)# distance bgp 20 200 200

Selectively, for specific prefixes

Router(config)# access-list 10 permit 10.20.0.0 0.0.255.255
Router(config-router)# distance 150 192.168.1.1 0.0.0.0 10

This changes AD to 150 only for routes matching ACL 10 received from neighbour 192.168.1.1.

Verification

Router# show ip route
Router# show ip route 10.20.0.0
Router# show ip protocols

In show ip route, each entry shows [AD/metric]:

D     10.20.0.0/16 [90/2172416] via 192.168.1.1, 00:04:12, GigabitEthernet0/1
                    └┬┘ └───┬──┘
                    AD    metric

show ip route <prefix> is the command to reach for when a route is not behaving, it shows the AD, the metric, the source protocol and the last update time in one place.

Where AD Manipulation Causes Trouble

  • Routing loops during redistribution. A route redistributed from OSPF into EIGRP comes back as external EIGRP (AD 170), but if you have lowered EIGRP’s AD, it may beat the original OSPF route and the router starts sending traffic back where it came from. This is the classic mutual-redistribution loop.
  • Inconsistent changes across routers. Router A prefers path X, Router B prefers path Y, and traffic ping-pongs between them.
  • Floating static set too low. If the backup AD is below the primary protocol’s, the backup is always active and the primary never used.
  • Forgetting external EIGRP is 170. After redistribution, EIGRP routes stop beating OSPF, and paths change in ways nobody expected.

The safe rule: change AD when you have a specific reason, document it, and apply it consistently across every router that participates in the affected paths.

Frequently Asked Questions

What does a lower administrative distance mean?

More trustworthy. The route source with the lowest AD wins and its route is installed in the routing table.

Why is eBGP more trusted than OSPF but iBGP less?

eBGP carries routes from outside your autonomous system, and you do not want your IGP overriding an external path. iBGP carries routes inside your AS, where your IGP has better topological knowledge, so iBGP is deliberately rated below every IGP at 200.

Is administrative distance advertised to other routers?

No. It is entirely local to the router making the decision. Changing it on one router affects only that router.

What is a floating static route?

A static route configured with an AD higher than the routing protocol it backs up, so it stays inactive until the protocol-learned route disappears. It is the standard way to configure a backup WAN link.

Can two routes with the same AD both be installed?

Yes, if they come from the same protocol and have equal metrics, the router load balances across them. Routes from different protocols with the same AD is an unusual state that generally means someone has manipulated AD and should reconsider.

What does AD 255 do?

It marks the route as untrusted, and the router will never install it. It is a way to disable a route without removing the configuration.

Are these values the same on Juniper or Arista?

No. Juniper calls the concept route preference and uses different defaults, OSPF internal is 10, static is 5. The mechanism is identical; the numbers are vendor-specific, so never assume Cisco’s table applies elsewhere. More in the routing protocols guide.

GU
Written by

Gurpreet Singh

Hey! I"m Gurpreet Singh and I Have 7+ Years of experience in the Network & Security Domain as well as the Cloud Infra Domain. I am Certified with Cisco ( CCNA ), CheckPoint ( CCSA ), 1xAWS, 3xAZURE, and 3xNSE. So I love to share my tech knowledge with you.

Leave a Reply

Your email address will not be published. Required fields are marked *