eBGP vs iBGP – What’s the Difference?

Border Gateway Protocol (BGP) is the fundamental routing protocol that powers the Internet. When discussing BGP, two distinct variations come up: internal BGP (iBGP) and external BGP (eBGP). While both are part of the same protocol, they function differently and serve specific purposes in network routing. So let’s explore the differences between eBGP vs iBGP, their roles, and the key distinctions in their operations.

The Structure of the Internet

To understand eBGP and iBGP, we first need to examine the structure of the Internet. BGP organizes the Internet into Autonomous Systems (ASes), which are independent networks controlled by various entities such as Internet Service Providers (ISPs) or large enterprises. Each AS is assigned a unique number and contains multiple BGP routers that manage network traffic.

BGP routers within an AS communicate with each other using iBGP, while routers that connect different ASes use eBGP to exchange routing information. This division allows BGP to efficiently route traffic across the Internet and within individual networks.

eBGP vs iBGP

Definition and Basic Difference

The primary distinction between eBGP vs iBGP lies in how they establish peerings:

  • eBGP is used when two BGP routers in different ASes establish a peering.
  • iBGP is used when two BGP routers in the same AS establish a peering.

For example, in a network with three routers (R1, R2, and R3), if R1 belongs to AS 100 and R2 to AS 200, the connection between them is an eBGP peering. On the other hand, if R1 and R3 both belong to AS 100, their connection is an iBGP peering.

Configuration Differences

To illustrate the configuration differences, let’s assume these routers are Cisco devices:

  • For an eBGP peering, the configuration on R1 might look like this:

    router bgp 100 neighbor 192.168.1.2 remote-as 200

    Here, the local AS is 100, and the remote AS is 200, confirming an eBGP peering.
  • For an iBGP peering, the configuration on R1 and R3 would look like this:

    router bgp 100 neighbor 192.168.1.3 remote-as 100

    Since both routers share the same AS number (100), this configuration establishes an iBGP peering.

While these configurations may seem similar, the way BGP behaves under each type of peering differs significantly.

eBGP vs iBGP - What's the Difference?
eBGP vs iBGP - What's the Difference? - telecomTech.io

Key Differences Between eBGP and iBGP

1. Peering Requirements

  • eBGP typically requires that peers be directly connected. Although this behavior can be modified, it is generally best practice.
  • iBGP does not require direct connectivity. Peering can occur over multiple hops as long as there is a valid route between the routers, usually provided by an Interior Gateway Protocol (IGP) like OSPF or EIGRP.

2. Full Mesh Requirement in iBGP

A significant rule in iBGP is the full mesh requirement:

  • iBGP mandates that all iBGP routers in an AS must be fully meshed, meaning each iBGP router must peer with every other iBGP router in the AS. This prevents routing loops but can lead to scalability issues in large networks.
  • eBGP does not require a full mesh. It follows a hierarchical model where BGP speakers communicate with directly connected peers.

To overcome the full mesh requirement in large iBGP networks, network engineers use Route Reflectors (RRs) and Confederations to reduce the number of peer connections needed.

3. Route Propagation Rules

  • eBGP allows learned routes to be advertised to other eBGP peers by default.
  • iBGP does not automatically advertise learned routes to other iBGP peers. Instead, network administrators must use Route Reflectors or other mechanisms to ensure proper route propagation.

4. Administrative Distance

Administrative Distance (AD) is a metric used by routers to determine the trustworthiness of a route source:

  • eBGP routes have an AD of 20, making them highly preferred over other BGP routes.
  • iBGP routes have an AD of 200, meaning they are considered less trustworthy than eBGP routes.

This distinction ensures that routers prioritize routes learned from external ASes over internal ones when making routing decisions.

5. Next-Hop Behavior

  • eBGP automatically changes the next-hop attribute to the IP address of the interface used to reach the eBGP peer.
  • iBGP, by default, does not change the next-hop attribute. This means the next-hop IP address remains as originally received, requiring additional configuration (such as using the next-hop-self command) to ensure proper routing within the AS.

For example, if router R2 advertises the 30.30.30.0/24 network to R1 via eBGP, R1 will update the next-hop to its own interface before advertising it further. However, when R1 shares this information with R3 using iBGP, the next-hop remains as R2 unless manually changed.

6. AS Path Handling

The AS Path attribute records the sequence of AS numbers a route has traversed. It is crucial for preventing routing loops and making path selection decisions:

  • eBGP prepends the local AS number to the AS Path before advertising routes to its peers. This ensures that BGP routers can determine the best path and prevent loops.
  • iBGP does not modify the AS Path when advertising routes to other iBGP peers within the same AS.

For example, if R2 (AS 200) advertises the 30.30.30.0/24 network to R1 (AS 100), R1 will prepend AS 100 to the AS Path before forwarding it to another eBGP peer. However, when R1 advertises the same route to R3 within AS 100 using iBGP, the AS Path remains unchanged.

Routing Must Already Be Established

A crucial prerequisite for using BGP, especially iBGP, is that internal routing within the AS must already be established. This is typically achieved using an Interior Gateway Protocol (IGP) like OSPF or EIGRP.

Many network engineers wonder why an IGP is needed if BGP is already being deployed. The reason is that BGP does not handle internal routing efficiently. Instead, an IGP is used to establish connectivity between iBGP peers, ensuring that BGP functions properly.

Summary

In conclusion, eBGP and iBGP are two different applications of the same protocol. Their differences lie in their implementation, peering rules, and behavior:

  • eBGP connects routers between different ASes, while iBGP connects routers within the same AS.
  • eBGP requires direct connections, while iBGP can operate over multiple hops.
  • iBGP requires a full mesh topology or the use of Route Reflectors to manage routing efficiently.
  • eBGP modifies the AS Path and next-hop attributes, while iBGP does not.
  • eBGP has a lower Administrative Distance (20) compared to iBGP (200).

Both eBGP and iBGP play critical roles in routing and maintaining the stability of the Internet. Understanding their differences is essential for network engineers designing scalable and efficient networks.

About:

Welcome to telecomTech, where telecom and networking technologies… are simply explained! I’m Lazarus, a telecom professional with over 25 years of experience in network design, architecture, and telecom technologies. Over my career, I’ve led major projects, trained professionals, and helped countless individuals earn certifications and advance their careers.  

My goal is to make networking and telecom concepts clear, practical, and engaging—the way I wish they were taught when I started learning!

Whether you’re a student, a professional growing your skills, or preparing for certifications like Cisco, telecomTech is here to guide you.

Join me as we explore telecom and networking as a lifelong passion, not just a job. Let’s make this journey of growth and discovery together!

Visited 5 times, 1 visit(s) today

Leave A Comment

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