Key Characteristics
| Feature | Description |
|---|---|
| Type | Path-vector |
| Algorithm | Based on AS-PATH, policy, and attributes |
| Transport | TCP port 179 |
| Metric | Multi-attribute (weight, local-pref, AS-path, etc.) |
| Scalability | Very high (Internet-grade) |
| Convergence | Slower than OSPF but stable |
| Authentication | MD5 optional |
| Use Case | ISP peering, hybrid cloud, WAN, and data centre edge |
BGP Concepts
| Term / Attribute | Description |
|---|---|
| AS (Autonomous System) | A group of routers under a single administrative domain |
| iBGP / eBGP | iBGP (internal) within the same AS; eBGP (external) between ASes |
| Neighbor (Peer) | Router that exchanges BGP updates with another |
| AS-PATH | Sequence of AS numbers a route has traversed (used for loop prevention) |
| NEXT_HOP | IP address of the next hop for reaching a destination |
| LOCAL_PREF | Preference for outbound routes within an AS (higher = preferred) |
| MED (Multi-Exit Discriminator) | Suggests preferred inbound route from neighbouring AS |
| Weight | Cisco-specific, local to the router; higher = preferred |
| Prefix Filtering | Controls which prefixes are advertised or accepted |
BGP Session Types
| Session Type | Description | Example |
|---|---|---|
| eBGP | Between routers in different ASes | AS 65001 ↔ AS 65002 |
| iBGP | Between routers in the same AS | AS 65001 ↔ AS 65001 |
| Route Reflector | iBGP router that redistributes routes to clients | Reduces iBGP full-mesh requirement |
Configuration Examples
- Cisco - eBGP
- Cisco - iBGP
- Linux (FRRouting)
- The router advertises
10.0.0.0/24to its eBGP neighbour in AS 65002 - BGP sessions use TCP port 179
- eBGP default TTL = 1 (directly connected peers only)
BGP in AWS and Cloud Context
AWS uses BGP for route propagation between:- Customer Gateway (CGW) and Virtual Private Gateway (VGW) in VPN setups
- Transit Gateway (TGW) and Direct Connect Gateways (DXGW)
- Hybrid environments — enabling dynamic route exchange with on-prem routers
Example AWS BGP Sessions
| Local Device | Peer | Type | AS Number | Notes |
|---|---|---|---|---|
| pfSense | AWS VGW | eBGP | 65001 ↔ 7224 | Routes advertised dynamically |
| Cisco ISR | AWS DXGW | eBGP | 65010 ↔ 64512 | Uses MD5 authentication over TCP 179 |
BGP Path Selection
BGP selects the best route using these attributes (in order):Security and Filtering
| Mechanism | Description |
|---|---|
| Prefix-lists / Route-maps | Limit which routes are advertised or received |
| MD5 Authentication | Protects against session hijacking |
| TTL Security / GTSM | Prevents spoofed packets from non-adjacent routers |
| Max-prefix Limit | Prevents accidental large route advertisements |
| Route Dampening | Avoids flapping route instability |
Example Security Configuration (Cisco)
Lab Exercise
Troubleshooting Commands
- Show Commands
- Debug Commands