Administrative distance

Last updated

Administrative distance (AD) or route preference [1] is a number of arbitrary unit assigned to dynamic routes, static routes and directly connected routes. The value is used in routers to rank routes from most preferred (low AD value) to least preferred (high AD value). [2] [3] When multiple paths to the same destination are available in its routing table, the router uses the route with the lowest administrative distance.

Contents

Router vendors typically design their routers to assign a default administrative distance to each kind of route. For example, on Cisco routers, routes issued by the Open Shortest Path First routing protocol have a lower default administrative distance than routes issued by the Routing Information Protocol. This is because, by default on Cisco routers, OSPF has a default administrative distance of 110 and RIP has a default administrative distance of 120. Administrative distance values can, however, usually be adjusted manually by a network administrator. [2]

Overview

The administrative distance (AD) value is assigned by the router on a per-protocol basis. Routers, by design, should not install multiple routes into the routing table as this has the potential to cause routing loops. [2] While a router may run multiple routing protocols on the same device, it is necessary for the router to implement a process to ensure that multiple routes, pointing to the same destination do not simultaneously exist in the routing table. Each process running on a router advertises its administrative distance value to the local router. The router uses this value to determine which route should be used. Once a route has been selected, the routing information database is updated. If two routes have the same administrative distance, the router uses its vendor-specific algorithm to determine which route should be installed. [2] Cisco routers simply ignore the values and fall back to the default values, which are never the same. [4]

The router will usually compare administrative distances to determine which protocol has the lowest value. The router prefers protocols that have a lower assigned administrative distance. For example, OSPF has a default distance of 110, so it is preferred by the router process, over RIP, which has a default distance of 120. The administrator can arbitrarily reconfigure the administrative distances, which affects the ranking of the preferred routes by the routing process. On Cisco routers, static routes have an administrative distance of 1, making them preferred over routes issued by a dynamic routing protocol. The administrative distance is a value that is always only referenced by the local router itself. The administrative distance is not advertised on the network. [2]

Default administrative distances

Cisco

The following table lists the default administrative distances for various routing protocols used on Cisco routers. [3]

Routing protocolAdministrative distance
Directly connected interface0 [a] [5]
Static route1
Dynamic Mobile Network Routing (DMNR)3
EIGRP summary route5
External BGP 20
EIGRP internal route90
IGRP 100
Open Shortest Path First (OSPF)110
Intermediate System to Intermediate System (IS-IS)115
Routing Information Protocol (RIP)120
Exterior Gateway Protocol (EGP)140
ODR 160
EIGRP external route170
Internal BGP 200
Next Hop Resolution Protocol (NHRP)250 [6]
Default static route learned via DHCP254[ citation needed ]
Unknown and unused255 [b]
  1. Only the interface itself has an administrative distance of 0, since a route cannot have a distance of less than 1.
  2. An administrative distance of 255 will cause the router to remove the route from the routing table and not use it.

Juniper

The following table lists the default administrative distances for various routing protocols used on Juniper routers. [7]

Routing protocolAdministrative distance
Directly connected interface0
Static routes5
OSPF internal routes10
IS-IS Level 1 Internal15
IS-IS Level 2 Internal18
RIP 100
Aggregate (route summary)130
OSPF external routes150
IS-IS Level 1 External160
IS-IS Level 2 External165
BGP170

Extreme Networks

The following table lists the default administrative distances used on ExtremeXOS / Switch-Engine.

Routing protocolAdministrative distance
Directly connected10
MPLS20
Blackhole50
Static1100
HostMobility1150
ICMP-Redirect1200
Fabric1699
eBGP1700
iBGP1900
OSPFintra2200
OSPFinter2300
IS-IS2350
IS-IS L12360
IS-IS L22370
RIP2400
OSPF AS Ext3100
OSPF Ext13200
OSPF Ext23300
IS-IS L1 Ext3400
IS-IS L2 Ext3500
Bootp5000

The following table lists the default administrative distances used on Extreme VOSS / Fabric-Engine.

Routing ProtocolAdministrative distance
Local0
Static5
SPBm L17
OSPFintra20
OSPFinter25
eBGP45
RIP100
OSPF Ext1120
OSPF Ext2125
iBGP175

    FortiGate

    The following table lists the default administrative distances for various routing protocols used on Fortinet FortiGate routers. [8]

    Routing protocolAdministrative distance
    Directly connected1
    Static routes10 [9]
    External BGP 20 [10]
    Open Shortest Path First (OSPF)110 [11]
    Routing Information Protocol (RIP)120
    Internal & Local BGP 200 [10]
    Kernel255 [12]

    Configuration

    Cisco IOS

    The network administrator may modify the administrative distance to change the desired ranking of routing protocols. This may be necessary in cases where multiple routing protocols are in use. [3] The Cisco Internetwork Operating System enables network administrators to modify the distance by changing the distance value in sub-router configuration mode. In the example below, RIP's administrative distance is changed to 89 so that it used in preference to OSPF. [3]

    R1#enable  R1#configure terminal  R1(config)#router rip  R1(config-router)#distance 89 

    Manually configuring the administrative distance is also required when configuring a floating static route. Floating static routes are used to provide an alternate path when a primary link fails. In order for static routes to be configured as a backup, the static route's administrative distance would need to be adjusted. Otherwise, it will take precedence over all routing protocols and routes issued from a routing protocol will not be inserted into the routing table. [3] The example below shows how to configure the administrative distance to 254 to specify that it should only be used as a last resort.

    R1(config)# ip route 10.0.0.0 255.0.0.0 backupLink 1 254

    In the event that two routing protocols are configured with the same administrative distance, the Cisco router will ignore the configured values and instead use the default values. [4]

    Verifying the configuration of the administrative distance is done on Cisco equipment using the show ip route command in privileged exec mode on the console of the Cisco router. [13] [14] In the example shown below, the administrative distance is 1. The letter "S" indicates that the route is a static route that has, for all intents and purposes, been added manually to the router process by the administrator and installed into the routing table.

    Router#enable  Router#configure terminal  Router(config)#ip route 1.1.1.0 255.255.255.0 fastEthernet 0/0  Router(config)#do show ip route 

    The do show ip route command will display the following, confirming that a static route has an administrative distance of 1.

    S 1.1.1.0/0 [1/0] via 172.31.0.1

    See also

    References

    1. "Route Preferences". Juniper Networks . Retrieved 2018-06-18.
    2. 1 2 3 4 5 Franck Le; Geoffrey G. Xie; Hui Zhang, Understanding Route Redistribution (PDF)
    3. 1 2 3 4 5 Cisco Systems (2013), What is Administrative Distance?, retrieved 14 September 2013
    4. 1 2 Cisco Systems(n.d.), Information About Routing, Cisco Systems Inc, retrieved 0109 2014
    5. Cisco, Default AD
    6. Cisco, NHRP
    7. Juniper, Default AD
    8. Fortinet, Technical Note : FortiGate IP route selection, and how to change the administrative distance (preference) of a routing protocol
    9. Fortinet, FortiGate CLI Reference Static Routes
    10. 1 2 Fortinet, FortiGate CLI Reference BGP
    11. Fortinet, FortiGate CLI Reference OSPF
    12. Fortinet, FortiGate CLI Reference Router Settings
    13. Cisco Systems (n.d), Configuring Static Routing, Cisco Systems Inc., retrieved 14 September 2013
    14. Cisco Systems (n.d), Show Commands, Cisco Systems Inc., retrieved 14 September 2013
    15. "Administrative Distance and Metric" . Retrieved 2021-12-23.
    16. "Understand the significance of administrative distance and metrics when working with routers" . Retrieved 2021-12-23.
    17. "Administrative distance & metric" . Retrieved 2021-12-23.