In dynamic routing, routers may receive multiple routes to the same destination from different protocols. To decide which route to use, they rely on Administrative Distance (AD), a ranking system that prioritizes routes based on the source’s reliability. The lower the AD, the more preferred the route.
The Border Gateway Protocol (BGP) assigns different AD values to external (eBGP) and internal (iBGP) routes. This distinction helps routers make accurate routing decisions in complex, multi-protocol networks.
In this article, we have explained the Administrative Distance (AD) in BGP, how it works, its purpose, and eBGP and iBGP AD values. We have also covered the configuration steps to update AD values in BGP.
Administrative Distance is a numerical value (ranging from 0 to 255) assigned to routing sources by a router to express the level of trustworthiness for making routing decisions.
During the routing process, a router can receive multiple routes from different protocols to reach the same destination, so to find the best route, it chooses the one with the lowest AD value.
Routers use default Administrative Distance (AD) values to decide which routing information to trust. The table below lists common default AD values used in Cisco networks.
Routing Source | AD Value |
---|---|
Connected Interface | 0 |
Static Route | 1 |
eBGP | 20 |
EIGRP (Internal) | 90 |
OSPF | 110 |
RIP | 120 |
EIGRP (External) | 170 |
iBGP | 200 |
Unknown/Untrusted Route | 255 |
*Note: AD = 255 means the route is considered invalid and will never be used.
The main goal of Administrative Distance is to help routers choose the most trustworthy route when multiple paths to the same destination are available from different sources, like connected interfaces, static routes, or routing protocols.
AD values also play a role in preventing routing loops. Suppose Router R1 learns a route via OSPF and advertises it to R2 through RIP.
For example, if Router R1 learns a route through OSPF and advertises it to R2 via RIP, and R2 sends it back to R1 using RIP (which has a higher AD), R1 will ignore it. This prevents the route from looping back unnecessarily.
Administrative Distance (AD) functions as a decision-making metric that allows a router to choose the most reliable path among multiple available routes to the same destination.
The router performs a series of evaluations in a specific order to determine which route to install in the routing table:
1. Connected Routes Take Priority
The router first checks whether the destination network is reachable through a directly connected interface. If such a route exists, it is immediately selected since connected routes have the highest trust level (AD = 0), and the router does not consider other options.
2. Static Routes Are Considered Next
If no connected route is available, the router checks for a manually configured static route. If a static route to the destination exists, it is chosen next, typically with an AD of 1.
3. Dynamic Routing Protocols Are Evaluated
When neither connected nor static routes are found, the router turns to dynamic routing protocols such as OSPF, EIGRP, or BGP. It compares the AD values associated with each protocol’s route to the same destination and selects the route with the lowest AD, indicating the highest trust.
4. Handling Equal AD Values
If multiple routes have identical AD values, the router uses a vendor-specific tie-breaking mechanism, such as selecting the path with the lowest metric or administrative preference, to determine the final route.
There are many distinctions between external and internal BGP AD values. They are explained in the table below:
Aspect | eBGP (External BGP) | iBGP (Internal BGP) |
---|---|---|
AD Value | 20 | 200 |
Route Origin | From an external Autonomous System (AS) | From within the same Autonomous System |
Preferred Use Case | Inter-AS routing (external reachability) | Intra-AS route distribution |
Trust Level | High–trusted for external routes | Lower – relies on IGP for next-hop reachability |
Loop Prevention | Built-in loop detection via AS Path | No automatic loop prevention – relies on additional mechanisms |
Design Intent | Preferred over IGPs and iBGP for external destinations | Less preferred than IGPs to avoid overriding internal paths |
Modifiability | Rarely modified | Sometimes lowered in MPLS/VPN scenarios |
In the case of Border Gateway Protocol (BGP), Cisco routers assign different default AD values to routes depending on how they were learned:
● eBGP (external BGP) routes have a default AD of 20
● iBGP (internal BGP) routes have a default AD of 200
● Locally originated BGP routes also default to 200
However, in certain scenarios, such as advanced enterprise or service provider environments, network administrators may need to adjust these values to influence route selection behavior.
In Cisco IOS, the AD values for BGP can be modified using the distance bgp command under the BGP configuration mode.
Command Format:
1. external-distance: AD for routes learned via external BGP (eBGP)
2. internal-distance: AD for routes learned via internal BGP (iBGP)
3. local-distance: AD for routes originated by the local router
Let's take an example scenario where you want to adjust iBGP to be Preferred Over OSPF.
By setting iBGP’s AD to 90, you're making it more preferred than OSPF (which has a default AD of 110).
If you want to practice these BGP configurations, check out our remote networking labs. Contact our learner advisors now!
Although BGP’s default AD values are effective in most environments, some advanced scenarios may require modification. Use cases include:
1. Prioritize iBGP Over IGP (e.g., OSPF or EIGRP)
In MPLS VPN, large-scale enterprise, or cloud environments, you may want iBGP-learned routes to be preferred over OSPF. To achieve this, lower the iBGP AD below that of the IGP.
2. Control Route Failover Behavior
By manipulating AD, you can define backup and primary paths. For instance, assign a static route with AD 10 and eBGP with AD 20 so that the static route is preferred unless it becomes unavailable.
3. Lab and Testing Environments
In controlled environments, adjusting AD helps simulate different routing behaviors and test protocol interactions under specific conditions.
The following are the best practices to be followed:
● Default values are usually optimal and consistent across devices.
● Use Local Preference, AS_PATH, or MED for route control instead of relying solely on AD.
● Record why and where AD values are changed to avoid confusion during troubleshooting.
● Always validate the impact of AD adjustments in a lab or staging environment.
● If adjusting AD values, confirm that appropriate backup routes exist.
The Administrative Distance of BGP is a vital factor in determining how routers prioritize BGP-learned routes against those from other protocols. With eBGP defaulting to 20 and iBGP to 200, routers naturally prioritize external BGP routes for inter-AS communication while preferring internal IGPs for intra-AS routing.
While BGP AD values rarely need changes in standard environments, understanding how and when to adjust them allows network engineers to create more tailored, scalable, and resilient routing designs. Correct usage of AD alongside proper BGP attributes and policies ensures optimal route selection and network performance.
He is a senior solution network architect and currently working with one of the largest financial company. He has an impressive academic and training background. He has completed his B.Tech and MBA, which makes him both technically and managerial proficient. He has also completed more than 450 online and offline training courses, both in India and ...
More... | Author`s Bog | Book a Meeting