Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 41

eBGP vs. iBGP: Understanding Relationships and Use Cases

Recommended resources

Hello! Welcome to the first lesson in our module on Advanced BGP Routing.

In our previous module, we mastered OSPF, a powerful Interior Gateway Protocol (IGP) designed for routing within a single administrative domain. We concluded by troubleshooting complex path selection issues. Now, we pivot to the protocol that governs routing between these domains and forms the backbone of the global internet: the Border Gateway Protocol (BGP).

This lesson addresses the learning outcome: Differentiate between eBGP and iBGP relationships and their use cases. While BGP is a single protocol, it operates in two distinct modes depending on where its peers are located. Understanding this distinction is the absolute foundation for mastering BGP.

1. The Role of BGP and the Autonomous System

IGPs like OSPF and EIGRP are designed for speed and efficiency within a network you control. They automatically discover neighbors and share detailed topology information to find the shortest path.

BGP, an Exterior Gateway Protocol (EGP), serves a different purpose. It's designed for massive scale and policy control between independent networks. Instead of just finding the shortest path, BGP makes decisions based on policies you define (e.g., business relationships, cost, security).

The core organizational concept in BGP is the Autonomous System (AS). An AS is a group of IP networks and routers under the control of one entity (like an ISP, a large enterprise, or a cloud provider), presenting a common routing policy to the internet. Every AS is assigned a unique Autonomous System Number (ASN).

This leads us to the two fundamental types of BGP peering:

  • External BGP (eBGP): Peering between routers in different ASes. This is how ASes exchange routes with each other.
  • Internal BGP (iBGP): Peering between routers in the same AS. This is used to carry external routing information across your own AS.
eBGP and iBGP Relationships Diagram
This diagram illustrates the core concept. Peering between routers in different ASes (e.g., AS150 to AS100) is eBGP. Peering between routers within the same AS (e.g., within AS100) is iBGP.

2. An Overview of eBGP vs. iBGP Differences

To begin, let's watch a video that provides a clear and concise overview of the fundamental differences in how eBGP and iBGP operate.

eBGP vs iBGP - What's the difference?

This video from telecomTech provides an excellent foundation, covering the core definitions and the most important behavioral differences between the two BGP modes.

Watch from the beginning to 02:03, and then from 03:20 to 08:18. Pay close attention to: The definition of an Autonomous System (AS). How peering is classified as eBGP or iBGP based on the ASN. The key differences in how Administrative Distance, the next-hop attribute, and the AS_PATH attribute are handled.


3. A Structured Comparison

The video gave us a great tour of the main differences. Let's now organize that information into a structured format that you can use as a quick reference. The following article provides an excellent comparison table and an FAQ section that addresses the most critical distinctions.

iBGP vs eBGP Differences – A Deep Dive

The following article provides a clear comparison table and a helpful FAQ section that drills down into the most important distinctions between iBGP and eBGP.

Please review two key parts of this article: The 'iBGP vs eBGP – Comparision' table. This is an excellent reference to solidify your understanding. The 'FAQ Section'. Read through questions 1 through 6, which directly address the differences in TTL, AS-PATH, the Split Horizon rule, and Next-Hop behavior.

Here is a summary of the most critical differences from the resources you just reviewed:

Feature eBGP (External) iBGP (Internal)
Purpose Exchanges routes between different ASes. Distributes external routes within the same AS.
AS Number Peers are in different ASes. Peers are in the same AS.
Admin. Distance 20 (Highly trusted) 200 (Less trusted than IGPs)
Next-Hop Changes to self by default. Does not change by default.
TTL 1 by default (assumes direct connection). 255 by default (peers can be many hops away).
Loop Prevention AS_PATH attribute. Rejects routes containing its own ASN. Split-horizon rule. A route from an iBGP peer is not sent to other iBGP peers.

4. Deep Dive: The Critical Next-Hop Behavior

One of the most important practical distinctions is how the next-hop attribute is handled. As noted, an iBGP speaker, by default, does not change the next-hop address when it advertises a route learned from an eBGP peer to its other iBGP peers.

This can create a situation where routers inside your AS receive a route with a next-hop IP that belongs to another AS—an IP they don't know how to reach. This makes the route unusable. This is a classic problem that requires a specific solution.

166 IPExpert BGP Peering ebgp and ibgp

The following video provides a detailed, practical demonstration of the next-hop problem in iBGP and its standard solution. Understanding this is crucial for building a functional BGP network.

Watch from 54:22 to 1:15:41. The presenter sets up a scenario with eBGP and iBGP peers. Focus on: How the eBGP-learned route is passed to the iBGP peer. Why the iBGP peer initially considers the route 'inaccessible' (the next-hop is not in its routing table). The role of an IGP in providing internal reachability. How the next-hop-self command on the border router resolves the issue by changing the next-hop to its own address.

The next-hop-self command is the standard way to fix this. It forces the border router to advertise itself, rather than the external peer, as the next-hop for routes it passes to its iBGP neighbors. Since the border router's address is known via an IGP, the route becomes valid.

Test your understanding!

A router (R1) in AS 65001 learns the route to 10.10.10.0/24 from an eBGP peer in AS 65002. R1 then advertises this route to its iBGP peer (R2), which is also in AS 65001.

  1. When R1 advertises the route to R2, what happens to the AS_PATH attribute?
  2. If R1 does not use next-hop-self, what will the next-hop IP address be for the route that R2 receives?
  3. What is the Administrative Distance of this route in R2's BGP table?
Show answer
  1. The AS_PATH attribute remains unchanged. When advertising to an iBGP peer, a router does not prepend its own AS number. R2 will see the AS_PATH as 65002.
  2. The next-hop will be the IP address of the original eBGP peer in AS 65002. This is the core iBGP next-hop behavior.
  3. The Administrative Distance will be 200. Routes learned from iBGP peers are given an AD of 200 to ensure they are less preferred than any IGP-learned routes used for internal connectivity.

5. Common Use Cases

Now that we understand the technical differences, let's see where eBGP and iBGP are used in real-world enterprise networks.

Real-World Use Case – Comparison Table

The article we reviewed earlier also has a concise table illustrating common scenarios for eBGP and iBGP.

Review the 'Real-World Use Case – Comparison Table'. This connects the theory to practical applications like connecting to ISPs, building a WAN core, or integrating with cloud services.

In summary:

  • You use eBGP anytime your network edge needs to talk to an external entity: connecting to one or more ISPs for internet access, peering directly with a business partner, or establishing a private connection to a public cloud like AWS or Azure.
  • You use iBGP to distribute those externally learned routes throughout your own network. This ensures all your internal routers have full visibility of internet routes and can make consistent, policy-based decisions on how to exit the AS, even if they aren't directly connected to the edge.

Conclusion

In this lesson, we established the fundamental distinction between BGP's two operational modes. They are not different protocols but different sets of rules applied by the same protocol, determined simply by whether the peering is between different ASes or within the same one.

Key Takeaways:

  • eBGP connects different Autonomous Systems; iBGP operates within a single AS.
  • This single distinction triggers different default behaviors for administrative distance, TTL, loop prevention mechanisms, and next-hop modification.
  • eBGP is highly trusted (AD 20) and uses the AS_PATH for loop prevention.
  • iBGP is less trusted (AD 200) to avoid conflicts with IGPs and uses a split-horizon rule for loop prevention.
  • The fact that iBGP does not change the next-hop by default is a critical operational detail that is typically resolved with the next-hop-self configuration on border routers.

Preview of the Next Lesson:

Now that you can differentiate between eBGP and iBGP relationships, our next step is to put this knowledge into practice. In the next lesson, you will learn to configure BGP peering for IPv4 and IPv6 using neighbor statements and verify session establishment. We will build a basic topology and bring up both an eBGP and an iBGP session.