Configure eBGP Between Two Autonomous Systems – Complete CCNP Guide

Configure eBGP Between Two Autonomous Systems – Complete CCNP Guide
Networking ATN Campus November 16, 2026 24 views

Configure eBGP Between Two Autonomous Systems – Complete CCNP Guide

BGP (Border Gateway Protocol) is the primary routing protocol used to exchange routing information between different Autonomous Systems (AS) on the Internet. External BGP (eBGP) establishes routing relationships between routers belonging to different autonomous systems.

But how do two autonomous systems establish an eBGP connection? How do they exchange network prefixes and learn routes from each other?

In this CCNP tutorial, you will learn how to configure eBGP between two autonomous systems using Cisco IOS commands. You will also understand BGP neighbor relationships, AS numbers, network advertisement, route verification, and common troubleshooting techniques.

1. What Is eBGP?

External Border Gateway Protocol (eBGP) is a type of BGP peering established between routers in different Autonomous Systems.

An Autonomous System (AS) is a collection of IP networks and routers managed under a common routing policy and identified by a unique Autonomous System Number (ASN).

For example, an enterprise network may connect to an Internet Service Provider (ISP) using eBGP. Both networks belong to different autonomous systems.

Example topology:

       Autonomous System 65001
              Enterprise
                  |
                  |
                 R1
                  |
             10.0.12.0/30
                  |
                 R2
                  |
                  |
       Autonomous System 65002
                  ISP

          eBGP Connection

R1 belongs to AS 65001, while R2 belongs to AS 65002. They establish an eBGP neighbor relationship to exchange routing information.

2. Important eBGP Characteristics

FeatureDescription
AS NumberseBGP operates between different autonomous systems.
Neighbor RelationshipRouters establish a BGP peering session using neighbor commands.
TCP PortBGP uses TCP port 179.
Default TTLeBGP normally uses a TTL of 1 for directly connected peers.
AS_PATHAdvertised routes include AS_PATH information to help prevent routing loops.
Route AdvertisementBGP advertises reachable network prefixes to its neighbors.
Administrative DistanceCisco IOS commonly uses 20 for eBGP routes.

3. eBGP vs iBGP

BGP supports two main types of peering relationships: eBGP and iBGP.

FeatureeBGPiBGP
AS RelationshipDifferent AS numbersSame AS number
PurposeExchange routes between ASesDistribute BGP routes within an AS
Default TTL1255
AS_PATHNormally adds the advertising ASDoes not add the local AS by default
Split HorizonNot applicable in the same wayRoutes learned from one iBGP peer are not advertised to another iBGP peer by default
Administrative Distance20 on Cisco IOS200 on Cisco IOS

4. Requirements for eBGP Configuration

Before configuring eBGP, ensure that the following requirements are satisfied:

  • Each router must have a unique and correct AS number.
  • The routers must have IP connectivity between their BGP neighbor addresses.
  • The correct neighbor IP address must be configured.
  • The remote-as value must match the neighbor's actual AS number.
  • TCP port 179 must not be blocked by an access control policy.
  • The network prefixes must exist in the local routing table before using BGP network statements.

5. Practical eBGP Lab Topology

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

       AS 65001                       AS 65002

    Enterprise Router              ISP Router

         R1 -------------------------- R2
       G0/0                            G0/0
    10.0.12.1 -------------------- 10.0.12.2
          /30                          /30

    Loopback0                       Loopback0
    192.168.1.1/24                  192.168.2.1/24

       eBGP Neighbor Relationship

IP Addressing Table

DeviceInterfaceIP Address
R1G0/010.0.12.1/30
R1Loopback0192.168.1.1/24
R2G0/010.0.12.2/30
R2Loopback0192.168.2.1/24

The two routers use different autonomous system numbers:

  • R1: AS 65001
  • R2: AS 65002

6. Step 1 – Configure IP Addresses on R1

First, configure the physical interface and loopback interface on R1.

enable
configure terminal

hostname R1

interface GigabitEthernet0/0
 description Connection-to-R2
 ip address 10.0.12.1 255.255.255.252
 no shutdown

interface Loopback0
 ip address 192.168.1.1 255.255.255.0

end

The physical interface provides connectivity between the two BGP routers. The loopback interface represents an internal enterprise network for advertisement.

7. Step 2 – Configure IP Addresses on R2

Now configure the ISP router.

enable
configure terminal

hostname R2

interface GigabitEthernet0/0
 description Connection-to-R1
 ip address 10.0.12.2 255.255.255.252
 no shutdown

interface Loopback0
 ip address 192.168.2.1 255.255.255.0

end

8. Step 3 – Verify Basic IP Connectivity

Before configuring BGP, verify that both routers can communicate with each other.

From R1:

ping 10.0.12.2

From R2:

ping 10.0.12.1

Both routers should successfully reach their directly connected neighbor.

9. Step 4 – Configure eBGP on R1

R1 belongs to AS 65001. Configure the BGP process and define R2 as an external BGP neighbor.

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

Explanation:

CommandPurpose
router bgp 65001Starts the BGP process using AS 65001.
neighbor 10.0.12.2 remote-as 65002Defines R2 as a BGP neighbor in AS 65002.
network 192.168.1.0 mask 255.255.255.0Advertises the matching local network prefix into BGP.

Important: The exact prefix and mask must exist in R1's IP routing table for the network statement to originate the route.

10. Step 5 – Configure eBGP on R2

R2 belongs to AS 65002. Configure the BGP neighbor relationship with R1.

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

R2 now identifies R1 as an external BGP neighbor and advertises its local network prefix.

11. Step 6 – Verify the BGP Neighbor Relationship

After configuring both routers, check whether the BGP session has been established.

show ip bgp summary

A successful BGP session should display the neighbor address and an established session state. The State/PfxRcd column should show the number of prefixes received rather than a connection-state name.

Example output:

R1# show ip bgp summary

Neighbor        AS       State/PfxRcd
10.0.12.2       65002    1

The value 1 indicates that R1 has received one BGP prefix from R2.

12. Step 7 – Verify Advertised BGP Routes

Use the following command to inspect the BGP routing table.

show ip bgp

On R1, you should see the network 192.168.2.0/24 learned from R2.

To inspect a specific prefix:

show ip bgp 192.168.2.0

The output provides information such as:

  • Next-hop address.
  • AS_PATH.
  • Origin attribute.
  • Best-path selection.
  • Neighbor information.

13. Step 8 – Verify the IP Routing Table

BGP routes can also be inspected in the main IP routing table.

show ip route bgp

On R1, the route to 192.168.2.0/24 should appear as a BGP route if it is selected and installed.

Example:

B 192.168.2.0/24 [20/0] via 10.0.12.2

The letter B represents a BGP-learned route. The administrative distance 20 is the common Cisco IOS default for eBGP.

14. Understanding AS_PATH in eBGP

One of the most important features of eBGP is AS_PATH.

When R2 advertises its prefix to R1, the AS number 65002 is added to the AS_PATH.

Prefix: 192.168.2.0/24

Advertised by R2:

AS_PATH: 65002

Received by R1 in AS 65001

AS_PATH helps BGP identify routing loops. If an eBGP router receives a route containing its own AS number in the AS_PATH, it normally rejects that route.

15. Common eBGP Troubleshooting Commands

CommandPurpose
show ip bgp summaryChecks BGP neighbor status.
show ip bgpDisplays the BGP routing table.
show ip bgp neighborsDisplays detailed neighbor information.
show ip routeChecks the IP routing table.
show ip interface briefChecks interface status and addresses.
show running-config | section router bgpDisplays BGP configuration.
pingTests IP connectivity.
tracerouteChecks the forwarding path.

16. Common eBGP Problems and Solutions

ProblemPossible CauseSolution
BGP session remains IdleIncorrect neighbor configuration or BGP process issueVerify AS numbers and neighbor settings.
BGP session remains ActiveTCP connection cannot be establishedCheck IP connectivity, ACLs, and TCP port 179.
Neighbor AS mismatchIncorrect remote-as configurationConfigure the correct remote AS number.
Prefix not advertisedNetwork statement does not match a routing-table prefixVerify the exact prefix and subnet mask.
Route not installedAnother route is preferred or the BGP next hop is unreachableInspect BGP attributes and next-hop reachability.
Routes not receivedRoute filtering or missing advertisementCheck prefix lists, route maps, and neighbor advertisements.

17. Frequently Asked Questions

Q1. What is eBGP?

eBGP is a BGP peering relationship between routers belonging to different autonomous systems.

Q2. Which TCP port does BGP use?

BGP uses TCP port 179 to establish neighbor sessions and exchange routing information.

Q3. What is the default administrative distance of eBGP on Cisco IOS?

The commonly used Cisco IOS default administrative distance for eBGP is 20.

Q4. Why do we configure remote-as?

The remote-as command identifies the autonomous system number of the BGP neighbor.

Q5. What happens when an eBGP router advertises a route?

The advertising router normally adds its own AS number to the AS_PATH attribute before sending the route to its external neighbor.

Q6. Can eBGP neighbors use loopback interfaces?

Yes. However, additional configuration is normally required, including reachability to the loopback addresses and the ebgp-multihop command when the peers are not directly connected in the usual single-hop arrangement.

18. Practical CCNP Lab Challenge

  1. Create two Cisco routers in different autonomous systems.
  2. Configure IP addresses on the physical interfaces.
  3. Configure loopback interfaces to represent internal networks.
  4. Verify connectivity between the routers.
  5. Configure eBGP neighbor relationships.
  6. Advertise the internal networks using BGP network statements.
  7. Verify the neighbor relationship using show ip bgp summary.
  8. Inspect the received routes using show ip bgp.
  9. Verify the learned routes using show ip route bgp.
  10. Intentionally configure an incorrect remote AS and observe the result.

Conclusion

Configuring eBGP between two autonomous systems is an essential skill for network engineers working with enterprise networks, service providers, and Internet routing.

By understanding AS numbers, neighbor relationships, network advertisement, and AS_PATH, you can establish external BGP sessions and exchange routing information between independent networks.

Practice the configuration in Cisco Packet Tracer where supported, or use Cisco IOS-compatible lab environments such as GNS3 and EVE-NG to develop your CCNP routing skills.

???? 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 hands-on 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