eBGP vs iBGP: Understanding the Core Differences in BGP Routing
The Border Gateway Protocol (BGP) is the backbone of internet routing, but many networking students struggle with the distinction between External BGP (eBGP) and Internal BGP (iBGP). This guide breaks down how both work, why they are necessary, and the key differences you need to know for CCNA, CCNP, and real-world networking.
What is BGP?
BGP is a path-vector routing protocol used to exchange routing information between autonomous systems (ASes). An AS is a collection of IP networks under a single administrative domain, identified by a unique Autonomous System Number (ASN).
What is eBGP?
External BGP (eBGP) runs between different autonomous systems. It is the protocol used to route traffic across the internet, connecting one organization’s network to another. eBGP peers are typically directly connected routers in different ASes. Key characteristics:
- AS-PATH attribute: Prevents routing loops by listing AS numbers a route has passed through.
- NEXT_HOP behavior: The next-hop IP is usually the IP of the eBGP peer’s interface.
- Default admin distance: 20 (lower than iBGP).
- TTL: Set to 1 by default (requires directly connected peers).
What is iBGP?
Internal BGP (iBGP) runs within a single autonomous system. It ensures that all routers inside the AS have consistent routing information to external destinations. iBGP peers do not need to be directly connected; they can communicate through the underlying IGP (e.g., OSPF or EIGRP). Key characteristics:
- Full mesh requirement: Every iBGP router must peer with every other iBGP router in the same AS, unless route reflectors or confederations are used.
- Loop prevention: Routes learned from an iBGP peer are not advertised to another iBGP peer by default (split horizon rule).
- NEXT_HOP: The next-hop IP remains unchanged as the route propagates inside the AS.
- Default admin distance: 200.
eBGP vs iBGP: Key Differences
| Aspect | eBGP | iBGP |
|---|---|---|
| Scope | Between different ASes | Within the same AS |
| Peering | Typically directly connected | Can be non-directly connected (via IGP) |
| Default AD | 20 | 200 |
| Loop prevention | AS-PATH attribute | Split horizon / no advertising iBGP routes to iBGP peers |
| TTL | 1 (default) | 255 (default) |
| Next-hop | Changed to eBGP peer’s IP | Unchanged (must be reachable via IGP) |
Why Use Both?
Without eBGP, you cannot exchange routes with other networks. Without iBGP, routers inside your AS would not learn external routes, leading to black holes. For example, if an edge router in AS 100 learns a route to 1.2.3.0/24 via eBGP from AS 200, it must use iBGP to distribute that route to other routers inside AS 100.
Route Reflectors and Confederations
To overcome the full mesh requirement of iBGP, Route Reflectors allow a router to reflect iBGP routes to other iBGP peers, reducing the number of peerings. Confederations break a large AS into smaller sub-ASes, using eBGP-like behavior between them while maintaining iBGP inside each sub-AS.
Best Path Selection
BGP selects the best path based on a sequence of attributes: weight, local preference, locally originated, AS-path length, origin type, MED, eBGP vs iBGP (eBGP preferred), and IGP metric to next-hop.
Real-World Example
Consider two ISPs: ISP1 (AS 100) and ISP2 (AS 200). They establish an eBGP session between their border routers. ISP1’s border router learns a route to 10.1.0.0/16 via eBGP and then uses iBGP to share it with internal routers. Without iBGP, traffic from inside ISP1 would not reach 10.1.0.0/16 correctly.
Summary
- eBGP connects different ASes, uses AS-PATH for loop prevention, and prefers directly connected peers.
- iBGP distributes routes inside the same AS, requires full mesh or route reflectors, and does not change next-hop.
- Both are essential for scalable, loop-free global routing.
Mastering these concepts is crucial for CCNA, CCNP, and any networking role involving BGP.