Configure a site‑to‑site VPN connection

This article explains how to configure a site‑to‑site (S2S) VPN connection between an on‑premises network and an Azure Virtual WAN hub using the Azure portal, Azure CLI, or PowerShell.

Prerequisites

Step‑by‑step guide

1. Create a Virtual WAN (if not already created)

# Azure CLI
az network wan create \
  --name MyWAN \
  --resource-group MyResourceGroup \
  --location eastus

2. Create a Virtual Hub

# Azure CLI
az network vhub create \
  --name MyHub \
  --resource-group MyResourceGroup \
  --wan MyWAN \
  --address-prefix 10.0.0.0/24 \
  --location eastus

3. Define the on‑premises VPN site

# Azure CLI
az network vpn-site create \
  --name OnPremVPNSite \
  --resource-group MyResourceGroup \
  --address-prefixes 192.168.10.0/24 \
  --location eastus \
  --vpn-device "Cisco ISR 4321" \
  --ip-address 203.0.113.10

4. Create the VPN connection

# Azure CLI
az network vhub connection create \
  --name S2SConnection \
  --resource-group MyResourceGroup \
  --vhub-name MyHub \
  --remote-vpn-site OnPremVPNSite \
  --routing-weight 10 \
  --connection-type SiteToSite \
  --shared-key "MySecretKey123"

5. Verify the connection

After provisioning, navigate to Virtual Hub > Connections in the Azure portal and confirm the status is Connected. You can also run:

# Azure CLI
az network vhub connection show \
  --name S2SConnection \
  --resource-group MyResourceGroup \
  --vhub-name MyHub

FAQ

What encryption algorithms are supported?
Azure Virtual WAN supports AES‑256, AES‑128, and 3DES. The default is AES‑256.
Can I use BGP over the S2S connection?
Yes. Enable BGP when creating the VPN connection and provide the ASN and BGP peer IP.