Pcornel
Browse topics
Options
Recent
Favorites
Cloud · Technical reference

VPN Gateway and ExpressRoute

Direct answer

Azure VPN Gateway connects networks to a VNet with IPsec over the internet (site-to-site, point-to-site, VNet-to-VNet). ExpressRoute connects on-premises to Microsoft over a private circuit from a connectivity provider, with BGP to two Microsoft edge routers. Both terminate in a virtual network gateway in the VNet's GatewaySubnet.

When to use this

Use it to design, verify and troubleshoot hybrid connectivity between on-premises and Azure.

First 30 seconds

1. Is the gateway provisioned with the expected SKU and type?

2. Is the connection Connected (VPN) / circuit Provisioned on both sides (ExpressRoute)?

3. Are BGP sessions up and are the expected prefixes learned and advertised?

4. Do VM effective routes point on-premises prefixes at the gateway?

Operational verification

on-premises router/VPN device → internet IPsec or provider circuit → MSEE (ExpressRoute) → virtual network gateway (GatewaySubnet) → BGP/static routes → VNet effective routes → NSGs → VM

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Azure VPN Gateway and ExpressRoute. Virtual WAN is the alternative for large hub designs.
Applicability is projected only from persisted Topic profile and Command metadata.
At a glance

Operational reference

Fast context before you go deeper.

PlatformAzure VPN Gateway and ExpressRoute. Virtual WAN is the alternative for large hub designs.
Key commandaz network vpn-connection show -g $RG -n cn-onprem \
Scope / prerequisiteUse it to design, verify and troubleshoot hybrid connectivity between on-premises and Azure.
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Read-only Verification Verify boundary
RG=rg-hub

# Gateways: type, SKU, active-active, BGP ASN
az network vnet-gateway list -g $RG --query "[].{name:name, type:gatewayType, vpn:vpnType, sku:sku.name, activeActive:activeActive, asn:bgpSettings.asn}" -o table

# VPN connection state and traffic counters
az network vpn-connection show -g $RG -n cn-onprem \
  --query "{status:connectionStatus, in:ingressBytesTransferred, out:egressBytesTransferred}"

# BGP peers and learned routes on the VPN gateway
az network vnet-gateway list-bgp-peer-status -g $RG -n vpngw-hub -o table
az network vnet-gateway list-learned-routes -g $RG -n vpngw-hub -o table

# ExpressRoute circuit: provider and Microsoft provisioning state
az network express-route show -g $RG -n er-cph \
  --query "{provider:serviceProviderProvisioningState, circuit:circuitProvisioningState, bandwidth:serviceProviderProperties.bandwidthInMbps}"
# Routes on the primary link of private peering
az network express-route list-route-tables -g $RG -n er-cph --path primary --peering-name AzurePrivatePeering -o table

# What a VM actually routes to on-premises
az network nic show-effective-route-table -g rg-app -n vm-app01-nic -o table
Step 2 Common mistakes Narrow the fault
  • Creating a new gateway on a non-AZ or Basic SKU.
  • Attaching an NSG or a default-route UDR to GatewaySubnet.
  • Treating ExpressRoute as encrypted.
  • Building one ExpressRoute circuit and calling it fully redundant across sites.
  • Static routes on the local network gateway that drift from the real on-premises networks, when BGP is available.
Step 3 Troubleshooting Narrow the fault

Tunnel up, no traffic. Check effective routes on the VM, NSGs on the VM subnet (not the GatewaySubnet), the on-premises return route and overlapping address spaces between sites.

Tunnel flaps. Mismatched IKE/IPsec lifetimes or proposals, DPD settings, or an on-premises device behind NAT changing its public IP. Gateway diagnostics (GatewayDiagnosticLog, TunnelDiagnosticLog, IKEDiagnosticLog) in Log Analytics show the negotiation.

Gateway creation fails. Wrong subnet name, subnet smaller than /27, an NSG attached, or a 0.0.0.0/0 UDR on GatewaySubnet.

ExpressRoute up, one path silent. One BGP session down means you run on a single MSEE; ask the provider/partner to check the secondary link before it becomes an outage.

Large packets fail over ExpressRoute. The ExpressRoute gateway does not support fragmented packets; adjust MSS/MTU or use FastPath where supported.

Key points

GatewaySubnet must be named exactly that, /27 or larger, with nothing else in it, no NSG and BGP route propagation enabled. Use AZ SKUs for new VPN gateways; policy-based cannot be converted to route-based. ExpressRoute is private but not encrypted by default; each circuit has two links to two MSEEs and needs both BGP sessions up.

Key checks
  • az network vnet-gateway show — SKU, type, active-active, BGP.
  • az network vpn-connection show — connectionStatus.
  • az network vnet-gateway list-bgp-peer-status / list-learned-routes.
  • az network express-route show / list-route-tables — circuit and provider state, routes per peering.
ReferenceWhat it is2 sections · depth on demand

Direct Answer

Two Azure services connect other networks to a VNet:

  • VPN Gateway — encrypted IPsec/IKE tunnels over the internet: site-to-site (an on-premises VPN device), point-to-site (individual clients over OpenVPN, IKEv2 or SSTP) and VNet-to-VNet.
  • ExpressRoute — a private circuit through a connectivity provider to Microsoft's edge. Traffic does not cross the public internet, giving predictable latency and higher bandwidth. Each circuit has two connections to two Microsoft Enterprise Edge routers (MSEEs) and Microsoft requires BGP on both.

Both end in a virtual network gateway deployed into a subnet that must be named GatewaySubnet. A VNet can have one VPN gateway and one ExpressRoute gateway at the same time, so VPN can serve as a backup path for ExpressRoute.

Scope and canonical references

This Topic covers Azure's hybrid gateways. Neighbouring Topics:

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

VPN Gateway

  • VPN type: route-based (routes decide what enters the tunnel; supports BGP, active-active, point-to-site) is the normal choice. Policy-based uses traffic selectors, works only with the Basic SKU, and cannot be converted — it must be deleted and recreated as route-based.
  • SKUs: zone-redundant VpnGw1AZ–VpnGw5AZ are recommended for new gateways; the non-AZ VpnGw1–5 SKUs are being migrated and should not be used for new deployments. Basic is legacy: no BGP, no zone redundancy, limited tunnels and throughput.
  • Active-active: two gateway instances, each with its own public IP and tunnel, and the same price as active-passive; pair it with two tunnels from on-premises and BGP for fast failover.
  • BGP is supported on all VpnGw SKUs and exchanges routes dynamically instead of maintaining static local network gateway prefixes.

ExpressRoute

  • Peerings: Azure private peering reaches VNets; Microsoft peering reaches Microsoft public services (such as Microsoft 365) over the circuit.
  • Redundancy: one circuit = two links to two MSEEs in one peering location. For maximum resiliency use two circuits in two peering locations.
  • Premium add-on: raises the private peering route limit from 4,000 to 10,000 prefixes, enables global reach across geopolitical regions and more VNet links. The Local SKU includes data transfer in the port price for nearby regions.
  • Gateway SKUs: ErGw1Az/2Az/3Az (and legacy Standard/HighPerformance/UltraPerformance) and the scalable ErGwScale. FastPath sends traffic straight to VMs, bypassing the gateway, on ErGw3Az/UltraPerformance and ErGwScale.
  • Encryption: ExpressRoute is private, not encrypted by default. Add IPsec over the circuit or MACsec on ExpressRoute Direct where encryption is required.

GatewaySubnet rules (both services): named exactly GatewaySubnet; /27 or larger (/29 only for Basic VPN; ExpressRoute with many circuits or coexistence needs more); nothing else deployed in it; no NSG; no 0.0.0.0/0 user-defined route; BGP route propagation must remain enabled.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
vpn gatewayazure vpn gatewayexpressroutegatewaysubnetsite-to-site vpn azurepoint-to-site vpnexpressroute fastpathmseeexpressroute circuitexpressroute peering
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

vpn-connection show: Connected with growing byte counters is healthy. Connected with out growing but in flat means traffic leaves Azure and nothing returns — check the on-premises route back and its firewall. NotConnected means IKE/IPsec did not establish: compare shared key, IKE version, proposals and the public IPs on both ends.

BGP peer status: Connected per peer is required; Connecting that never progresses means wrong peer IP/ASN or the BGP endpoint is not reachable through the tunnel. In active-active mode expect a session per instance.

Learned routes: on-premises prefixes should appear with origin EBgp (or Network for local); missing prefixes mean the far side does not advertise them or a filter drops them.

ExpressRoute show: provider: Provisioned and circuit: Enabled mean both the provider and Microsoft have finished; NotProvisioned on the provider side means the provider order is not complete — nothing on the Azure side will fix that. Route tables on the primary and secondary path should show the same on-premises prefixes; a prefix only on one path means you have lost redundancy for it.

Effective routes: on-premises prefixes with next hop type VirtualNetworkGateway prove the VM will use the gateway; if they are missing, route propagation is disabled on the subnet's route table or the gateway has not learned them.

Design & tradeoffs

Design decisions

VPN vs ExpressRoute. VPN is fast to set up and cheap, but shares the internet's latency and loss; ExpressRoute gives predictable latency and higher bandwidth at the cost of provider lead time and monthly circuit fees. Many designs use ExpressRoute as primary with a site-to-site VPN as backup through the coexisting VPN gateway.

Redundancy. Zone-redundant gateways, active-active VPN with two on-premises devices, and for critical workloads two ExpressRoute circuits in two peering locations.

Hub-and-spoke. Put gateways in a hub VNet and let spokes use them through peering with gateway transit; beyond roughly 100 site-to-site tunnels or many regions, consider Virtual WAN.

Address planning. Reserve a GatewaySubnet larger than /27 if coexistence or more circuits are likely, and keep on-premises and Azure address spaces from overlapping.

Confirmation

Confirm action

Continue?