When configuring Point-to-Site (P2S) VPNs in Azure, you'll notice the platform mandates a special subnet named GatewaySubnet
. This isn't just Azure being opinionated - there are solid architectural reasons:
- Service Isolation: The gateway runs multiple Azure-managed components (route processors, VPN endpoints, BGP speakers) that require dedicated network space
- IP Reservation: Azure reserves the first four IPs (x.x.x.0-x.x.x.3) for internal routing infrastructure
- High Availability: Active/standby instances need predictable addressing for failover scenarios
Contrary to simple router implementations, Azure VPN Gateways are distributed services with these key components:
// Example showing minimal gateway subnet declaration
az network vnet subnet create \
--name GatewaySubnet \
--vnet-name myVNet \
--resource-group myRG \
--address-prefixes 10.0.3.0/24
Component | IP Usage | Purpose |
---|---|---|
Route Processors | First 4 IPs | Handles VNet route propagation |
VPN Endpoints | Next available IPs | Terminates client VPN connections |
BGP Speakers | Additional IPs | Border Gateway Protocol sessions |
The subnet size directly impacts your deployment options:
# PowerShell equivalent for gateway creation
New-AzVirtualNetworkSubnetConfig
-Name "GatewaySubnet"
-AddressPrefix "10.0.3.0/27" | # Minimum /27 for Basic SKU
Add-AzVirtualNetworkSubnetConfig
- /29: Absolute minimum (deprecated)
- /27: Recommended for Basic SKU
- /26: Required for VpnGw2+ SKUs
- Never deploy other resources in this subnet
Watch for these frequent pitfalls:
- Insufficient IP Space: Error
Failed to allocate virtual network gateway IPs
- Name Mismatch: Must be exactly "GatewaySubnet" (case-sensitive)
- Concurrent Modifications: Changes block during gateway provisioning
For production deployments, always reference the current Azure subnet requirements as specifications evolve with new gateway SKUs.
When configuring Point-to-Site (P2S) VPN in Azure, you'll encounter the requirement for a dedicated gateway subnet. Unlike regular subnets that host your VMs or services, this special subnet serves as the foundation for Azure's virtual network gateway services.
The gateway subnet hosts critical infrastructure components that power Azure's VPN capabilities:
- Routing engines that manage traffic between on-premises and cloud networks
- Encryption processors for secure VPN tunnels
- Health monitoring agents
- Load balancers for gateway redundancy
Here's how to properly create a gateway subnet using Azure CLI:
az network vnet subnet create \\
--name GatewaySubnet \\
--vnet-name myVNet \\
--resource-group myResourceGroup \\
--address-prefixes 10.0.3.0/27
The gateway subnet must:
- Always be named "GatewaySubnet" (case-sensitive)
- Use at least a /27 CIDR block (smaller may cause deployment failures)
- Not contain any other resources (VMs, load balancers, etc.)
Azure automatically allocates IPs from your gateway subnet for:
Primary Gateway IP: 10.0.3.4
Secondary Gateway IP (active-active): 10.0.3.5
Internal Load Balancer IP: 10.0.3.6
Monitoring Agents: 10.0.3.7-10.0.3.10
When gateway subnet issues occur, check:
- Sufficient IP space (expand to /26 if needed)
- No NSGs blocking gateway communication
- No overlapping with on-premises networks