Understanding BGP and Core Internet Routing Protocols
What Is BGP and Why Is It Critical?
BGP (Border Gateway Protocol) is the path-vector protocol that interconnects autonomous systems (AS) on the internet. It enables routers to exchange reachability information, ensuring data packets find the best path across networks. Without BGP, global traffic exchange would collapse.
Step 1: Grasp the Core Internet Routing Protocols
Internet routing protocols fall into two categories: interior and exterior.
- IGPs (Interior Gateway Protocols) – used within a single AS; examples: OSPF (Open Shortest Path First), IS-IS, EIGRP.
- EGPs (Exterior Gateway Protocols) – used between AS; only BGP (specifically eBGP) handles this role today.
Routing tables store best paths; BGP updates propagate across peers using TCP port 179.
Step 2: Understand Autonomous Systems and AS Numbers
An autonomous system is a network under a single administrative domain. Each AS has a unique 16-bit or 32-bit ASN (AS Number) assigned by RIRs (Regional Internet Registries).
- Public ASNs – used for eBGP peering with ISPs or carriers.
- Private ASNs (64512-65535) – used inside an AS for iBGP or BGP confederations.
Route exchange between ASes is governed by BGP policy, not only metric metrics.
Step 3: Learn BGP Path Selection Attributes
BGP selects the best route using multiple tie-breaking steps. Key attributes:
- Weight (Cisco proprietary; highest wins)
- Local preference (highest wins within AS)
- Originate via network or aggregate (preferred over learned routes)
- AS path length (shortest path wins)
- Origin code (IGP < EGP < incomplete)
- Multi-exit discriminator (MED) (lowest wins between same AS neighbors)
- eBGP over iBGP, then IGP metric
Step 4: Distinguish eBGP vs. iBGP
eBGP (External BGP) runs between ASes. Routes from eBGP peers have a lower administrative distance (20 on Cisco) and are assumed trusted. iBGP (Internal BGP) runs inside the same AS; routes have administrative distance 200. iBGP requires full mesh or route reflectors to avoid loops.
Step 5: Configure Basic BGP Peering
Typical eBGP configuration on a Cisco router:
router bgp 65001
neighbor 203.0.113.1 remote-as 65002
neighbor 203.0.113.1 password mysecret
address-family ipv4 unicast
network 192.0.2.0 mask 255.255.255.0
Verify with show ip bgp summary. BGP requires stable TCP connectivity and proper TTL (1 for eBGP by default).
Step 6: Master Route Aggregation and Filtering
Avoid route flapping by summarizing prefixes near AS borders. Use prefix-lists and AS-path ACLs to filter. BGP communities (e.g., NO_EXPORT) control route propagation across peers.
Step 7: Troubleshoot BGP Common Issues
- Prefix not advertised – check
networkcommand or redistribution. - Stuck in Active state – firewall blocking TCP 179 or wrong neighbor IP.
- Route flapping – enable BGP dampening.
- Suboptimal path – tune local preference or MED.
Final Tips for BGP in the Real World
BGP scales by design. Use route reflectors and peer groups to reduce CPU and memory. For IPv6, rely on MP-BGP (Multiprotocol BGP) using address family IPv6 unicast. Continually monitor BGP tables via looking glasses or RIPE RIS.