PacketLab
Unit 1 · External BGP

External BGP (eBGP)

Connect two routers in different autonomous systems. Establish the session first, then advertise one network from each side and verify the result.

Network and setup

R1 uses AS 65010; R2 uses AS 65020. Their GigabitEthernet1 interfaces share 192.0.2.0/30. Each router has a loopback for its router ID and a separate loopback network to advertise.

Direct eBGP labIllustrative topology
Customer · AS 65010Provider · AS 65020192.0.2.0/30Gi1 · .1Gi1 · .2R1Lo0: 10.255.0.1/32R2Lo0: 10.255.0.2/32Lo10: 198.51.100.1/24Lo10: 203.0.113.1/24
Solid line: physical link. Interface names and addresses match the configurations. All addresses and AS numbers are lab examples.
Interface names vary by image. Start with two fresh routers and connect Gi1 to Gi1. All verification output below is illustrative, not collected from a running lab.
Initial interface configuration · R1 and R2

R1

enable
configure terminal
hostname R1
interface GigabitEthernet1
 ip address 192.0.2.1 255.255.255.252
 no shutdown
exit
interface Loopback0
 ip address 10.255.0.1 255.255.255.255
exit
interface Loopback10
 ip address 198.51.100.1 255.255.255.0
exit
end

R2

enable
configure terminal
hostname R2
interface GigabitEthernet1
 ip address 192.0.2.2 255.255.255.252
 no shutdown
exit
interface Loopback0
 ip address 10.255.0.2 255.255.255.255
exit
interface Loopback10
 ip address 203.0.113.1 255.255.255.0
exit
end

Before configuring BGP, check the direct link from both sides.

Illustrative router output · selected lines
R1# ping 192.0.2.2
!!!!!
Success rate is 100 percent (5/5)
Illustrative router output · selected lines
R2# ping 192.0.2.1
!!!!!
Success rate is 100 percent (5/5)

A failed ping here points to interface addressing, link state, or filtering. Fix that before continuing.

Configure neighbors

Define the local AS, identify the neighbor’s address and AS, and activate IPv4 unicast. This example disables implicit IPv4 activation so the address-family step is explicit.

R1

configure terminal
router bgp 65010
 bgp router-id 10.255.0.1
 no bgp default ipv4-unicast
 neighbor 192.0.2.2 remote-as 65020
 address-family ipv4 unicast
  neighbor 192.0.2.2 activate
 exit-address-family
end

R2

configure terminal
router bgp 65020
 bgp router-id 10.255.0.2
 no bgp default ipv4-unicast
 neighbor 192.0.2.1 remote-as 65010
 address-family ipv4 unicast
  neighbor 192.0.2.1 activate
 exit-address-family
end

router bgp sets the local AS. remote-as names the other router’s AS. Different local and remote ASes make this an eBGP relationship.

Optional neighbor authentication

For TCP MD5 authentication, set the same neighbor password at both endpoints. This authenticates TCP segments; it does not encrypt BGP or user traffic. The value below is a lab example.

R1

configure terminal
router bgp 65010
 neighbor 192.0.2.2 password PacketLabLab
end

R2

configure terminal
router bgp 65020
 neighbor 192.0.2.1 password PacketLabLab
end

A missing or different password prevents a new authenticated TCP connection. Apply matching settings on both lab routers and recheck the session. Existing sessions may reset during changes.

Verify the session

Use the summary on each router. At this stage we have not originated any BGP prefixes.

Illustrative excerpt · R1
R1# show ip bgp summary
BGP router identifier 10.255.0.1, local AS number 65010
Neighbor       V      AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down  State/PfxRcd
192.0.2.2      4   65020       8       8      1   0    0 00:03:10            0

Neighbor addresses and remote ASes must match the opposite router. Where adjacency logging is enabled, a successful connection can also produce:

Illustrative adjacency notifications
R1: %BGP-5-ADJCHANGE: neighbor 192.0.2.2 Up
R2: %BGP-5-ADJCHANGE: neighbor 192.0.2.1 Up

A number in State/PfxRcd indicates an established session and the number of accepted prefixes. Zero is normal before route origination. A word such as Active means the session is not Established.

Illustrative router output · selected lines
R2# show ip bgp summary
Neighbor       V      AS  Up/Down  State/PfxRcd
192.0.2.1      4   65010  00:03:10             0
Illustrative router output · selected lines
R1# show ip bgp neighbors 192.0.2.2
BGP neighbor is 192.0.2.2, remote AS 65020, external link
  BGP version 4, remote router ID 10.255.0.2
  BGP state = Established, up for 00:03:10

R2 should identify R1 as remote AS 65010. The detailed neighbor view should report Established and remote router ID 10.255.0.2 on R1.

Verify routes

Illustrative excerpt · R1 after both advertisements
R1# show ip bgp
     Network          Next Hop       Metric LocPrf Weight Path
 *> 198.51.100.0/24   0.0.0.0             0         32768 i
 *> 203.0.113.0/24    192.0.2.2           0             0 65020 i

R1# show ip route bgp
B    203.0.113.0/24 [20/0] via 192.0.2.2

R1 originated 198.51.100.0/24 locally. It learned 203.0.113.0/24 from R2, with next hop 192.0.2.2 and AS path 65020. The final i is the origin code; it does not mean this is an iBGP neighbor.

Illustrative excerpt · R2 after both advertisements
R2# show ip bgp
     Network          Next Hop       Metric LocPrf Weight Path
 *>  198.51.100.0/24  192.0.2.1           0             0 65010 i
 *>  203.0.113.0/24   0.0.0.0             0         32768 i

R2# show ip route bgp
B    198.51.100.0/24 [20/0] via 192.0.2.1

R2 has the reciprocal view: its own prefix is local, and R1’s prefix has AS path 65010. The default administrative distance for an installed eBGP route is 20; the bracketed 0 is the route metric.

The BGP table and IP routing table are separate checks. In this clean lab the remote prefix should be installed. On R2, the reciprocal learned prefix is 198.51.100.0/24 through 192.0.2.1.

Illustrative router output · selected lines
R1# ping 203.0.113.1 source 198.51.100.1
!!!!!
Success rate is 100 percent (5/5)
Illustrative router output · selected lines
R2# ping 198.51.100.1 source 203.0.113.1
!!!!!
Success rate is 100 percent (5/5)

These source-specific tests exercise both learned routes. An established session alone does not prove data-plane reachability.

Packet view

Illustrative message exchange and UPDATE fields

This is a constructed protocol view, not a recorded capture. BGP messages can share a TCP segment or span multiple segments.

StepObservation
TCP setupOne peer connects to the other’s TCP port 179.
OPEN exchangePeers identify their ASes, router IDs, and supported session parameters.
KEEPALIVE exchangeSuccessful establishment is confirmed.
R2 advertises its prefixUPDATE: NLRI 203.0.113.0/24; AS_PATH 65020; NEXT_HOP 192.0.2.2.

A lab capture on Gi1 can use display filter tcp.port == 179. Session states and individual message formats have their own later lessons.

Troubleshooting

ObservationFirst checks
Idle / ActiveLink reachability, neighbor address, remote AS, IPv4 activation, TCP 179 access.
Established, zero prefixesNetwork statements and exact local routing-table entries.
Prefix in BGP, absent from IP tableRoute validity and competing routes in the IP routing table.

Final configurations

R1 and R2 · complete base lab

This base configuration omits the optional password. If you use authentication, add the matching password command at both endpoints.

R1

configure terminal
hostname R1
interface GigabitEthernet1
 ip address 192.0.2.1 255.255.255.252
 no shutdown
exit
interface Loopback0
 ip address 10.255.0.1 255.255.255.255
exit
interface Loopback10
 ip address 198.51.100.1 255.255.255.0
exit
router bgp 65010
 bgp router-id 10.255.0.1
 no bgp default ipv4-unicast
 neighbor 192.0.2.2 remote-as 65020
 address-family ipv4 unicast
  neighbor 192.0.2.2 activate
  network 198.51.100.0 mask 255.255.255.0
 exit-address-family
end

R2

configure terminal
hostname R2
interface GigabitEthernet1
 ip address 192.0.2.2 255.255.255.252
 no shutdown
exit
interface Loopback0
 ip address 10.255.0.2 255.255.255.255
exit
interface Loopback10
 ip address 203.0.113.1 255.255.255.0
exit
router bgp 65020
 bgp router-id 10.255.0.2
 no bgp default ipv4-unicast
 neighbor 192.0.2.1 remote-as 65010
 address-family ipv4 unicast
  neighbor 192.0.2.1 activate
  network 203.0.113.0 mask 255.255.255.0
 exit-address-family
end

Key Takeaways

  • Configure each neighbor explicitly: router bgp sets the local AS and remote-as identifies the other AS.
  • Different AS numbers make the relationship eBGP; IPv4 unicast must be active for this lab.
  • A numeric State/PfxRcd value means Established; zero prefixes is normal before advertisements.
  • A network statement originates an exact prefix already installed in the local routing table.
  • Verify both BGP tables, installed IP routes and source-specific pings; session state alone does not prove forwarding.

External BGP Quiz

Six questions · four options each · select one answer per question. Submit all answers to see your score and explanations.

1. R1 uses AS 65010 and R2 uses AS 65020. What identifies R2’s AS in R1’s configuration?
2. The State/PfxRcd column shows 0. What does it mean in this lab?
3. R1 has a connected 198.51.100.0/24 but no 198.51.0.0/16 route. Which network statement originates the connected prefix?
4. R1 sees 203.0.113.0/24 via 192.0.2.2 with AS path 65020 i. What is the final i?
5. Optional neighbor passwords are configured on both routers. What must be true?
6. A BGP session is Established. Which check tests the two advertised destination networks together?
References and lab notes

Command behavior: basic BGP configuration · TCP MD5 authentication.

Check interface names and feature support on the selected router software. Router-symbol attribution.