BGP Fundamentals: eBGP vs iBGP Explained – Complete CCNP Guide

BGP Fundamentals: eBGP vs iBGP Explained – Complete CCNP Guide
Networking ATN Campus November 13, 2026 30 views

BGP Fundamentals: eBGP vs iBGP Explained – Complete CCNP Guide

Border Gateway Protocol (BGP) is one of the most important routing protocols used to connect networks across the internet. It allows different autonomous systems to exchange routing information and determine how traffic should travel between networks.

BGP is commonly used by Internet Service Providers (ISPs), large enterprises, cloud providers, and organizations with multiple internet connections.

There are two main types of BGP peering: External BGP (eBGP) and Internal BGP (iBGP). Understanding the differences between them is essential for CCNP Enterprise networking and real-world network engineering.

In this tutorial, you will learn BGP fundamentals, autonomous systems, eBGP vs iBGP, BGP neighbor relationships, and practical Cisco router configuration.

1. What Is BGP?

BGP stands for Border Gateway Protocol. It is a path-vector routing protocol used to exchange routing information between autonomous systems.

An Autonomous System (AS) is a group of IP networks and routers managed by one organization under a common routing policy.

Examples of organizations that use BGP include:

  • Internet Service Providers (ISPs).
  • Cloud service providers.
  • Large enterprise networks.
  • Internet exchange points.
  • Organizations with multiple internet connections.

BGP helps these networks exchange reachable IP prefixes and make routing decisions based on routing policies and path attributes.

2. What Is an Autonomous System Number?

An Autonomous System Number (ASN) is a unique identifier assigned to an autonomous system for routing purposes.

BGP uses AS numbers to identify the autonomous systems through which a route has travelled.

Examples:

ASNExample
64512Private-use ASN
65001Private-use ASN
13335Example of a public ASN
15169Example of a public ASN

ASNs are available in 16-bit and 32-bit formats. Private ASN ranges include 64512–65534 for 16-bit private ASNs and 4200000000–4294967294 for 32-bit private ASNs.

3. What Is eBGP?

eBGP stands for External Border Gateway Protocol. It is used to exchange routing information between routers belonging to different autonomous systems.

Example:

       AS 65001                 AS 65002

        Router1 --------------- Router2
              eBGP Connection

Router1 belongs to AS 65001, while Router2 belongs to AS 65002. Since the routers belong to different autonomous systems, their BGP relationship is eBGP.

Common eBGP use cases:

  • Connecting an enterprise network to an ISP.
  • Connecting two different service providers.
  • Exchanging routes between separate organizations.
  • Connecting an enterprise to multiple internet providers.

4. What Is iBGP?

iBGP stands for Internal Border Gateway Protocol. It is used to exchange BGP routing information between routers belonging to the same autonomous system.

Example:

             AS 65001

        +----------------+
        |                |
       R1 -------------- R2
              iBGP

Both routers belong to AS 65001. Therefore, their BGP relationship is iBGP.

Common iBGP use cases:

  • Sharing external BGP routes inside an enterprise AS.
  • Distributing internet routing information between edge routers.
  • Supporting redundant internet gateway designs.
  • Building scalable service-provider routing architectures.

5. eBGP vs iBGP – Main Differences

FeatureeBGPiBGP
Full NameExternal BGPInternal BGP
AS RelationshipDifferent AS numbersSame AS number
Main PurposeExchange routes between ASesDistribute BGP routes within an AS
Default Administrative Distance on Cisco IOS20200
AS_PATH BehaviorNormally prepends the local AS when advertising to an eBGP peerNormally does not add the local AS when advertising to an iBGP peer
Next-Hop BehaviorNormally sets the next hop to the advertising router's addressNormally preserves the existing next hop
Loop PreventionAS_PATH loop detectionDoes not re-advertise routes learned from one iBGP peer to another iBGP peer

Administrative distance values shown above are Cisco defaults for BGP route selection in the routing table. They are not BGP path-selection attributes.

6. Understanding BGP Neighbor Relationships

BGP routers establish a neighbor relationship, also called a BGP peering session, using TCP port 179.

Unlike many interior routing protocols, BGP does not automatically discover neighbors. Administrators configure BGP neighbors manually.

Important BGP session states include:

StateMeaning
IdleBGP is waiting to start or restart the connection process.
ConnectBGP is attempting to establish a TCP connection.
ActiveBGP is trying to establish a TCP connection after a previous attempt failed or timed out.
OpenSentAn OPEN message has been sent.
OpenConfirmBGP is waiting for a KEEPALIVE message or notification.
EstablishedThe BGP session is active and can exchange routing information.

7. Basic BGP Configuration – eBGP Lab

Let's configure eBGP between two Cisco routers in different autonomous systems.

Network Topology

       AS 65001                  AS 65002

    +-----------+              +-----------+
    |    R1     |--------------|    R2     |
    +-----------+              +-----------+
     10.0.12.1                  10.0.12.2

IP addressing plan:

RouterInterfaceIP AddressAS Number
R1G0/010.0.12.1/3065001
R1Loopback0192.168.1.1/2465001
R2G0/010.0.12.2/3065002
R2Loopback0192.168.2.1/2465002

Step 1: Configure R1 Interfaces

enable
configure terminal

interface gigabitEthernet 0/0
 ip address 10.0.12.1 255.255.255.252
 no shutdown
exit

interface loopback 0
 ip address 192.168.1.1 255.255.255.0
exit

Step 2: Configure R2 Interfaces

enable
configure terminal

interface gigabitEthernet 0/0
 ip address 10.0.12.2 255.255.255.252
 no shutdown
exit

interface loopback 0
 ip address 192.168.2.1 255.255.255.0
exit

Step 3: Configure eBGP on R1

router bgp 65001
 neighbor 10.0.12.2 remote-as 65002
 network 192.168.1.0 mask 255.255.255.0

Step 4: Configure eBGP on R2

router bgp 65002
 neighbor 10.0.12.1 remote-as 65001
 network 192.168.2.0 mask 255.255.255.0

The neighbor command identifies the remote BGP router and its autonomous system number.

The network command advertises a prefix into BGP only when that exact prefix exists in the local routing table.

8. Basic BGP Configuration – iBGP Lab

Now let's configure two routers inside the same autonomous system.

Network Topology

             AS 65010

       +-----------+       +-----------+
       |    R1     |-------|    R2     |
       +-----------+       +-----------+
         10.0.12.1           10.0.12.2

              iBGP

R1 Configuration

router bgp 65010
 neighbor 10.0.12.2 remote-as 65010
 network 192.168.1.0 mask 255.255.255.0

R2 Configuration

router bgp 65010
 neighbor 10.0.12.1 remote-as 65010
 network 192.168.2.0 mask 255.255.255.0

Because both routers use AS 65010, the relationship is iBGP.

9. Important iBGP Rule – Split-Horizon Behavior

One important BGP rule is that a route learned from an iBGP neighbor is not normally advertised to another iBGP neighbor.

This behavior prevents routing loops within the autonomous system.

Consider this topology:

             AS 65010

                R1
               /  \
              /    \
             R2----R3

             iBGP

If R1 learns a route from R2 through iBGP, it does not advertise that route to R3 through another iBGP session.

In a full-mesh iBGP design, every router must establish an iBGP session with every other router in the same AS. For larger networks, Route Reflectors or BGP Confederations can reduce the need for a full mesh.

10. BGP Verification Commands

Check BGP Neighbors

show ip bgp summary

This command displays BGP neighbor addresses, AS numbers, session states, and message counters.

Check the BGP Routing Table

show ip bgp

Check a Specific BGP Prefix

show ip bgp 192.168.2.0

Check the IP Routing Table

show ip route bgp

Check BGP Configuration

show running-config | section router bgp

11. Common BGP Troubleshooting Problems

ProblemPossible CauseSolution
BGP remains in IdleConfiguration issue or session not startingCheck neighbor configuration and routing reachability
BGP remains in ActiveTCP connection failureCheck IP connectivity, TCP port 179, and ACLs
Neighbor AS mismatchIncorrect remote-as commandVerify both AS numbers
Session Established but no routes appearMissing network statement or route policyCheck advertised prefixes and filters
Routes appear in BGP but not in routing tableAnother route is preferred or next hop is unreachableCheck next-hop reachability and route selection

12. Frequently Asked Questions

Q1. What is BGP?

BGP is a path-vector routing protocol used to exchange routing information between autonomous systems.

Q2. What is the difference between eBGP and iBGP?

eBGP exchanges routes between different autonomous systems, while iBGP exchanges BGP routes within the same autonomous system.

Q3. Which transport protocol does BGP use?

BGP uses TCP port 179 to establish neighbor sessions.

Q4. What is an ASN?

An Autonomous System Number identifies an autonomous system in BGP routing.

Q5. What is a BGP Route Reflector?

A Route Reflector is a router that reduces the need for a full mesh of iBGP sessions by reflecting routes between configured clients and other peers.

13. Practical CCNP Lab Challenge

  1. Build a two-router eBGP topology.
  2. Configure AS 65001 and AS 65002.
  3. Establish an eBGP neighbor relationship.
  4. Advertise a loopback network from each router.
  5. Verify the BGP session using show ip bgp summary.
  6. Check advertised and received routes.
  7. Convert the lab to an iBGP design using the same AS number on both routers.
  8. Observe the differences in BGP behavior.
  9. Introduce an incorrect remote AS and troubleshoot the neighbor session.

Conclusion

BGP is the foundation of inter-domain routing on the internet. Understanding autonomous systems, eBGP, iBGP, neighbor relationships, and BGP route advertisement is essential for advanced enterprise and service-provider networking.

Practice the configurations and verification commands in a Cisco lab environment to strengthen your CCNP routing knowledge.

???? Advance Your Networking Career with ATN Campus

Want to master advanced routing and switching? Visit ATN Campus to explore CCNA, CCNP Enterprise, BGP, OSPF, EIGRP, network security, and practical Cisco networking labs.

???? Learn Networking. ???? Master Advanced Routing & Switching. ???? Practice with Real Labs. ???? Prepare for CCNP Certifications. ???? Build Your IT Career with ATN Campus.
Document ATN CAMPUS