Connect Networks with Site to Site VPN Connections
Setting up Site to Site Connection
Guide to configuring a site-to-site IPsec/IKE VPN between an on-premises network and Azure using PSK
In this guide you’ll learn how to establish a site-to-site (S2S) IPsec/IKE VPN tunnel between an on-premises network and Azure. The example below uses an Azure VNet with address space 10.1.0.0/16 and an on-premises branch network 10.0.0.0/24 — ensure your networks do not overlap. The Azure VPN Gateway terminates the tunnel to your on-premises edge device’s public static IP and authenticates using a pre-shared key (PSK).
Quick architecture summary:
Azure VNet: 10.1.0.0/16
On-premises: 10.0.0.0/24
Tunnel: IPsec/IKE (site-to-site)
Authentication: PSK (pre-shared key)
On-premises device: reachable static public IP (entered as the Local Network Gateway)
Verify your appliance or software against the Microsoft validated devices list. Many modern devices work with Azure if correctly configured.
Route-based vs policy-based
Route-based VPNs are recommended for most scenarios (flexible, simpler to manage). Policy-based is supported only on certain gateway SKUs and use-cases.
IPsec / IKE parameters
Ensure encryption, integrity/hash, DH group, lifetime, and IKE version match on both sides. Mismatches prevent negotiation.
Public IP reachability
The on-premises device must have a static public IP (or FQDN). Azure needs this value in the Local Network Gateway (LNG). Dynamic IPs may break the tunnel when they change.
Authentication (PSK)
Use a strong PSK; configure the same key on both sides. Store the PSK securely.
Ensure the on-premises device uses a static public IP and that you store the PSK securely. If you must use dynamic addressing, consider alternatives such as certificate-based authentication or a dynamic DNS solution — each has operational implications.
If you need more detail about supported devices and configuration examples, see:
Local Network Gateway (LNG) — what it is and how to create it
The Local Network Gateway is an Azure resource that stores:
The on-premises VPN device public IP (or FQDN)
The on-premises address prefixes (for routing)
Optional BGP ASN and peering information if you use BGP
Create an LNG via the portal:
Navigate to Local network gateways → Create.
Provide name (e.g., LNG-NYC), region, public IP or FQDN (e.g., 131.1.12.13) and on-premises address prefixes (e.g., 10.0.0.0/24).
Add BGP settings under Advanced if using dynamic routing.
Note: Azure stores the LNG metadata; it does not validate connectivity when the LNG is created. The Virtual Network Gateway references the LNG when building the connection.CLI example — create LNG:
For VPN-based VNet-to-VNet connections, each VNet must have its own VPN Gateway. Each gateway terminates the respective tunnel.
This approach requires two gateways (and associated costs). Consider VNet peering (with gateway transit when necessary) if you do not need gateway-level isolation or cross-tenant VPN connectivity.
By validating device compatibility, using a static public IP, matching PSK and IPsec/IKE settings, and creating a Local Network Gateway followed by a Site-to-Site connection in Azure, you can establish a reliable S2S VPN tunnel between your on-premises network and Azure.Later sections cover point-to-site connections and include a demo on enabling gateway transit.