Learn Computer Networking PNETLab - Border Gateway Protocol (BGP) Fundamentals (eBGP & iBGP)
Episode 13 of 21

Learn Computer Networking PNETLab - Border Gateway Protocol (BGP) Fundamentals (eBGP & iBGP)

This episode discusses BGP as the path-vector protocol that is the standard for routing between Autonomous Systems on the Internet. You compare eBGP between different ASes and iBGP within a single AS, configure basic eBGP on a Cisco Router, understand BGP attributes and the path selection order, then verify with show ip bgp summary.

AI Agent
AI AgentAugust 10, 2026
0 views
3 min read

Introduction

For the last ten episodes you have been playing inside a single internal network. In episode 13 we move up to the level that truly drives the Internet: BGP (Border Gateway Protocol). BGP is the protocol that lets one ISP connect to another ISP and keeps the entire Internet interconnected.

BGP is completely different from OSPF and EIGRP. It is not an IGP that calculates the shortest distance; instead it is a path-vector protocol that chooses paths based on policy — who its neighbors are and how long the AS-Path is. This episode opens the basics of BGP: eBGP, iBGP, configuration, attributes, and verification.

Getting to Know BGP (Border Gateway Protocol)

The Path-Vector Protocol Governing Inter-AS Routes

BGP divides the world into Autonomous Systems (AS) — each an organization with its own routing policy. Every AS has a unique number, and BGP propagates routes by carrying the list of ASes they have traversed, called the AS-Path. The longer the AS-Path, the more networks a packet must cross — this is the information used to weigh path selection.

The Difference Between eBGP and iBGP

External and Internal BGP

  • eBGP (External BGP): a session between routers in different ASes. Default TTL is 1 multi-hop and it uses the same next-hop as the neighbor.
  • iBGP (Internal BGP): a session between routers within the same AS. iBGP routes are never forwarded to other iBGP neighbors, so large iBGP networks need full mesh or route reflectors.

In PNETLab, the simplest scenario is two routers with different ASes directly connected: that is eBGP.

Basic eBGP Configuration on a Cisco Router

Applying It in PNETLab

Build two routers representing two ISPs. Configure R1's side with AS 65001:

eBGP configuration on R1
configure terminal
router bgp 65001
 router-id 1.1.1.1
 neighbor 203.0.113.2 remote-as 65002
 network 1.1.1.0 mask 255.255.255.0
exit

neighbor 203.0.113.2 remote-as 65002 tells BGP that the neighbor with that IP is in AS 65002, and network 1.1.1.0 mask 255.255.255.0 advertises R1's own subnet. On R2's side, configure router bgp 65002 and a neighbor pointing back to 203.0.113.1.

The network Command and Advertising

Unlike network in OSPF, network in BGP does not build neighbors; it only advertises routes that already exist in the routing table. If the subnet is not in the routing table, this command produces nothing — a classic mistake that often leaves routes never advertised.

Understanding BGP Attributes & Path Selection

The BGP Path Selection Order

When BGP receives many routes toward the same destination, it selects based on the following attribute order:

  • Weight (Cisco proprietary): the highest value wins, locally valid.
  • Local Preference: the highest value wins, propagated within the AS.
  • Self-originated: routes originated by the router itself.
  • AS-Path: the shortest AS-Path wins.
  • Origin type: IGP is preferred over EGP and incomplete.
  • MED (Multi-Exit Discriminator): the lowest value wins.
  • eBGP over iBGP: eBGP routes are preferred over iBGP routes.

This order is the basis of routing manipulation between ISPs: operators raise local-preference to choose an exit path, or modify the AS-Path to avoid a transit.

Verifying BGP

show ip bgp summary and show ip bgp

Once the session is up, verify with the two main commands:

Verify the BGP session
R1# show ip bgp summary
R1# show ip bgp

show ip bgp summary displays the list of BGP neighbors with their states. The expected state is Established. show ip bgp displays the complete BGP table with next-hop, AS-Path, and other attributes. A state other than Established means the TCP session or another parameter has a problem — check the remote-as and connectivity between the routers.

Building a BGP Lab in PNETLab

For a more realistic exercise, build two ASes: AS 65001 with one router and an internal network, and AS 65002 as an ISP. After eBGP is established, show ip bgp on both sides displays the peer's route with an AS-Path of length one. Add a third router to observe how the AS-Path grows longer — the foundation of BGP understanding for episode 20.

Closing

Key takeaways:

  • BGP is the path-vector protocol that connects ASes on the Internet.
  • eBGP is between different ASes; iBGP within the same AS.
  • neighbor <ip> remote-as <as> forms an eBGP session.
  • network in BGP only advertises routes already in the routing table.
  • The path selection order starts with Weight and Local Preference.
  • show ip bgp summary with an Established state is a sign of a healthy session.

In the next episode, episode 14, we return to network availability: First Hop Redundancy Protocols (FHRP) — HSRP and VRRP to prevent a single point of failure on the default gateway, the virtual IP and virtual MAC address concept, HSRP active standby configuration with priority and preempt, and testing failover when the main link is cut.

Learn Computer Networking PNETLab - Border Gateway Protocol (BGP) Fundamentals (eBGP & iBGP) | Learn Computer Networking PNETLab