eBGP Introduction

May 6, 2025 - Reading time: 5 minutes

In our previous lesson, we focused on iBGP—how routers within a single Autonomous System (AS) exchange routes internally. Now, we’ll turn our attention outward. External BGP (eBGP) handles routing between different ASes and is the backbone of how the Internet connects networks worldwide. Although eBGP uses many of the same commands and principles as iBGP, its peering relationships and behavior differ because each router typically belongs to a separate AS. In this lesson, we’ll step through a simple two-router eBGP lab, illustrate how to configure each side, and verify that both routers successfully advertise and learn each other’s routes.

What is eBGP?

  • eBGP stands for External Border Gateway Protocol.
  • It is used to exchange routes between different Autonomous Systems (e.g., between an enterprise network and its Internet Service Provider, or between two different ISPs).
  • Each eBGP peer is typically a router under a distinct AS number, and the default Time to Live (TTL) for eBGP sessions assumes the routers are directly connected (one hop away).


eBGP peering and network advertising

Topology Overview

We will configure two routers, R1 and R2, connected on a single Ethernet link:

   R1 (AS 65000)          R2 (AS 65001)
       Loopback0:              Loopback0:
       1.1.1.1/24              2.2.2.2/24
            |                        |
    Fa0/0: 192.168.12.1/24 --- 192.168.12.2/24 :Fa0/0

Key Points:

  • R1 is in AS 65000.
  • R2 is in AS 65001.
  • The routers have direct IP connectivity on the 192.168.12.0/24 subnet.
  • Each router advertises its loopback network via eBGP.

We will not use an IGP in this lab. Instead, each router sees the other’s IP on the directly connected subnet.


Device Setup

Router R1 (AS 65000)

  1. Assign IP addresses:
R1# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)# interface FastEthernet0/0
R1(config-if)# ip address 192.168.12.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit

R1(config)# interface Loopback0
R1(config-if)# ip address 1.1.1.1 255.255.255.0
R1(config-if)# exit
R1(config)# end
R1#
  1. Configure eBGP:
R1# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)# router bgp 65000
R1(config-router)# neighbor 192.168.12.2 remote-as 65001
R1(config-router)# network 1.1.1.0 mask 255.255.255.0
R1(config-router)# end
R1#

Note: remote-as 65001 is different from R1’s local AS 65000, which is what makes this an eBGP relationship.


Router R2 (AS 65001)

  1. Assign IP addresses:
R2# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)# interface FastEthernet0/0
R2(config-if)# ip address 192.168.12.2 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# exit

R2(config)# interface Loopback0
R2(config-if)# ip address 2.2.2.2 255.255.255.0
R2(config-if)# exit
R2(config)# end
R2#
  1. Configure eBGP:
R2# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)# router bgp 65001
R2(config-router)# neighbor 192.168.12.1 remote-as 65000
R2(config-router)# network 2.2.2.0 mask 255.255.255.0
R2(config-router)# end
R2#

Verification Commands

The following commands help confirm the eBGP session is established and that routes are exchanged properly.

show ip bgp summary

R1:

R1# show ip bgp summary
BGP router identifier 1.1.1.1, local AS number 65000
BGP table version is 2, main routing table version 2
1 network entries, 1 paths using 128 bytes of memory
Neighbor        V    AS   MsgRcvd   MsgSent   TblVer  InQ  OutQ  Up/Down  State/PfxRcd
192.168.12.2    4  65001       10       10        2    0     0 00:02:35        1
  • Key Points:
    • local AS number 65000
    • Neighbor is AS 65001
    • State/PfxRcd = 1 means R1 has learned one prefix (2.2.2.0/24) from R2.

R2:

R2# show ip bgp summary
BGP router identifier 2.2.2.2, local AS number 65001
BGP table version is 2, main routing table version 2
1 network entries, 1 paths using 128 bytes of memory
Neighbor        V    AS   MsgRcvd   MsgSent   TblVer  InQ  OutQ  Up/Down  State/PfxRcd
192.168.12.1    4  65000        8        8        2    0     0 00:02:12        1
  • Key Points:
    • local AS number 65001
    • Neighbor is AS 65000
    • State/PfxRcd = 1 indicates R2 has learned one prefix (1.1.1.0/24) from R1.

show ip bgp

R1:

R1# show ip bgp
BGP table version is 2, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.0/24       0.0.0.0                  0      0  32768 i
*> 2.2.2.0/24       192.168.12.2             0      0        65001 i
  • *> 1.1.1.0/24: This is locally originated on R1 (weight 32768).
  • *> 2.2.2.0/24: Learned from AS 65001 (Path = 65001) and selected as best path.

R2:

R2# show ip bgp
BGP table version is 2, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 2.2.2.0/24       0.0.0.0                  0      0  32768 i
*> 1.1.1.0/24       192.168.12.1             0      0        65000 i
  • *> 2.2.2.0/24: Locally originated on R2.
  • *> 1.1.1.0/24: Learned from AS 65000 (Path = 65000) and selected as best path.

show ip route

R1:

R1# show ip route
Codes: C - connected, S - static, B - BGP, O - OSPF, E - EIGRP, etc.

     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
B       2.2.2.0 [20/0] via 192.168.12.2, 00:01:24
     192.168.12.0/24 is subnetted, 1 subnets
C       192.168.12.0 is directly connected, GigabitEthernet0/0
  • 2.2.2.0/24 is learned via BGP (marked B) from R2.

R2:

R2# show ip route
Codes: C - connected, S - static, B - BGP, O - OSPF, E - EIGRP, etc.

     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     1.0.0.0/24 is subnetted, 1 subnets
B       1.1.1.0 [20/0] via 192.168.12.1, 00:02:03
     192.168.12.0/24 is subnetted, 1 subnets
C       192.168.12.0 is directly connected, GigabitEthernet0/0
  • 1.1.1.0/24 is learned via BGP from R1.

Ping Tests

To ensure end-to-end reachability between the loopback networks:

On R1:

R1# ping 2.2.2.2 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/6/8 ms

On R2:

R2# ping 1.1.1.1 source 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 2.2.2.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/5/7 ms

Because each router has a BGP route to reach the other’s loopback, the pings succeed.


Troubleshooting

Troubleshooting eBGP issues involves checking neighbor relationships, verifying route advertisements, and ensuring correct AS numbers and IP configurations. Common problems include mismatched ASNs, unreachable peers & incorrect next-hop handling. Follow the link for a detailed walkthrough of troubleshooting steps and command examples.


Challenge

  • Download the Scenario Labs: BGP1 & BGP2 (version 2.6 required)
  • Apply the correct fix and verify that the sessions are restored.
  • Use the verification commands below to troubleshoot the issue:

    show ip bgp summary
    show ip bgp
    show ip route
    ping <neighbor-IP>

    clear ip bgp * <-- reset the BGP establishments
    if needed

eBGP Introduction | PocketCLI

Download


>