Border Gateway Protocol (BGP)
What it is
Border Gateway Protocol (BGP) is the standard exterior routing protocol that exchanges routing information between autonomous systems (ASes). In Azure it’s how your on-premises edge and ExpressRoute/VPN infrastructural peers advertise routes to (and receive routes from) Azure networks.
Why it exists
Static routes must be manually updated whenever the network changes. BGP automates route exchange and failover: each side advertises the networks it can reach, and the path metric (AS path) decides the best route. This keeps hybrid connectivity resilient without human edits.
Key ideas
- eBGP is used between Azure virtual network gateways and on-premises BGP peers (VPN gateway or ExpressRoute).
- BGP peers advertise routes; Azure learns what to route to your on-premises prefixes and announces your VNet prefixes back.
- AS numbers (ASN) — each side configures a peer ASN (Azure gateway uses a private ASN you specify; on-prem peer has its own).
- BGP is optional for VPN gateways (you can use Policy-Based/static instead) but is a primary mechanism for ExpressRoute.
- BGP-learned routes coexist with route tables; BGP routes take precedence over system routes but not over UDRs (User-defined > BGP > system).
Key facts
- If you’re advertising a default route (0.0.0.0/0) via BGP, it can force all internet traffic on-prem (forced tunneling) — preview official behavior.
- VPN Gateway + BGP gives active-active / failover and dynamic route updates on topology changes.
- Azure private ASN range for gateways is typically 64512–65534 (private ASN).
How it fits
[on-prem router ASN 65000] [Azure gateway ASN 64512]
│ BGP session (eBGP over IPsec/ER) │
│ advertise corp prefixes <────> │
│ receive VNet prefixes │
▼ ▼
on-prem network VNet routes
Diagram courtesy of Microsoft Learn / Azure docs: expressroute/expressroute-optimize-routing
Exam notes
- BGP is most relevant to hybrid connectivity (ExpressRoute and site-to-site VPN with dynamic routing).
- Not needed for VNet peering or internal Azure routing.
- Remember precedence: UDR > BGP > system, with longest-prefix-match always resolved first.
Related
Home · expressroute · vpn-gateway · route-table · virtual-wan
📘 Source: Microsoft Learn — Bgp