BGP Support for Azure VPN Gateway

This document provides a comprehensive overview of Border Gateway Protocol (BGP) support for Azure VPN Gateway. BGP is essential for enabling dynamic routing between your on-premises networks and Azure virtual networks.

Introduction to BGP in Azure

Azure VPN Gateway supports BGP, a dynamic routing protocol that allows your network to exchange routes with Azure. This is particularly useful for complex network topologies and for establishing more robust and scalable site-to-site VPN connections.

When you enable BGP on your VPN gateway, it acts as a BGP peer to your on-premises VPN device (or another Azure VPN gateway). This enables the exchange of network reachability information, allowing for automatic route propagation and optimal path selection.

Key BGP Features and Benefits

BGP Attributes

BGP uses several attributes to determine the best path. Key attributes include:

Supported Scenarios

BGP is highly recommended for the following scenarios:

Note: For basic site-to-site VPNs with a single connection and no complex routing requirements, static routing might be sufficient.

Configuration Steps

Enabling BGP for your Azure VPN Gateway involves a few key steps:

  1. Configure BGP on your on-premises VPN device: Ensure your device supports BGP and is configured with an AS number and BGP peer IP address.
  2. Create a Virtual Network Gateway: Deploy a VPN gateway in Azure. Ensure it's configured with a private IP address space that does not overlap with your on-premises networks.
  3. Configure BGP Settings for the Gateway:
    • ASN: Assign a unique AS number (typically 65515 or another private AS number) to your Azure VPN Gateway.
    • BGP Peer IP Address: This is the private IP address of the gateway's BGP control plane interface (e.g., 169.254.x.x).
  4. Establish a Site-to-Site Connection: Create a connection resource in Azure, linking your local network gateway (representing your on-premises device) to the VPN gateway. Enable BGP for this connection.
  5. Configure BGP on your Local Network Gateway: Provide the AS number and BGP peer IP address of your on-premises VPN device within the Azure Local Network Gateway configuration.

Once configured, BGP sessions will be established, and routes will be exchanged.


# Example Azure CLI snippet (conceptual)
az network vpn-gateway create \
    --resource-group MyResourceGroup \
    --name MyVpnGateway \
    --location westus \
    --gateway-type Vpn \
    --sku VpnGw2 \
    --vpn-type RouteBased \
    --public-ip-address MyVpnGatewayPip \
    --location westus \
    --asn 65515 \
    --enable-bgp true

az network local-gateway create \
    --resource-group MyResourceGroup \
    --name MyLocalGateway \
    --location westus \
    --gateway-ip-address 203.0.113.25 \
    --asn 65500 \
    --bgp-peer-ip 10.1.1.254 # Your on-premises BGP peer IP

az network vpn-connection create \
    --resource-group MyResourceGroup \
    --name MyVpnConnection \
    --vnet-gateway1 MyVpnGateway \
    --local-gateway2 MyLocalGateway \
    --shared-key 'YourSharedKey' \
    --connection-type IPsec \
    --enable-bgp true
            

Troubleshooting BGP

If you encounter issues with BGP peering or route propagation, consider the following:

Tip: The Azure VPN Gateway uses an automatically assigned private IP address in the 169.254.x.x range for its BGP control plane. This address is visible in the gateway's configuration.

For more detailed troubleshooting steps and common issues, refer to the official Azure VPN Gateway BGP troubleshooting guide.