This domain (20–25%) is hybrid connectivity: getting on-premises sites and remote users into Azure. Questions typically give a bandwidth, resilience, encryption or geography requirement and ask you to choose between VPN, ExpressRoute and Virtual WAN, or to fix a broken tunnel or circuit.
Site-to-site VPN
Building blocks
| Resource | Role |
|---|---|
| GatewaySubnet | /27 or larger. Holds the gateway VMs |
| VPN gateway (virtual network gateway, type VPN) | The Azure endpoint. One VPN gateway per VNet. Needs a Standard static public IP (two for active-active) |
| Local network gateway | Azure’s description of the on-premises device: its public IP (or FQDN) and its address prefixes (or BGP peer address and ASN). Update it when on-premises prefixes change (unless you use BGP) |
| Connection | Links the VPN gateway to the local network gateway: type IPsec (Site-to-site), shared key, IPsec/IKE policy, BGP on/off |
Gateway deployment takes roughly 30–45 minutes. Gateway SKU changes within the same family and generation can be done in place. Changing between non-compatible SKUs means recreating.
Policy-based vs route-based
| Policy-based | Route-based | |
|---|---|---|
| Traffic selectors | Fixed prefix pairs (static) | Any-to-any (0.0.0.0/0), routing decides |
| IKE | IKEv1 only | IKEv1 and IKEv2 |
| Tunnels | One S2S tunnel | Many tunnels (multi-site) |
| BGP | No | Yes |
| P2S, VNet-to-VNet, active-active, coexistence with ExpressRoute | No | Yes |
| SKU | Basic only | VpnGw1-5 (and AZ variants) |
Pick route-based unless a legacy device can only do policy-based tunnels. If an on-premises device is policy-based but you need route-based on Azure, use UsePolicyBasedTrafficSelectors on the connection and a custom IPsec/IKE policy so Azure matches the device’s selectors. The old Basic SKU is legacy and shouldn’t be your answer for new designs.
Gateway SKUs
SKUs are VpnGw1 to VpnGw5 and the zone-redundant AZ versions (VpnGw1AZ to VpnGw5AZ). Generation 1 and Generation 2 exist for some SKUs. The higher the SKU, the more aggregate throughput and more S2S tunnels and P2S connections.
| SKU | Approx. aggregate throughput | S2S tunnels | Notes |
|---|---|---|---|
| VpnGw1 | ~650 Mbps | up to 30 | Entry production SKU |
| VpnGw2 | ~1 Gbps (Gen1) | up to 30 | |
| VpnGw3 | ~1.25 Gbps (Gen1) | up to 30 | |
| VpnGw4 | ~5 Gbps (Gen2) | up to 100 | Gen2 only |
| VpnGw5 | ~10 Gbps (Gen2) | up to 100 | Gen2 only |
Remember the order of magnitude (hundreds of Mbps up to 10 Gbps) and the S2S tunnel limit of 30 versus 100. AZ SKUs spread the two gateway instances across availability zones and need Standard zone-redundant public IPs. For resilience in a zone region, choose an AZ SKU. A VPN gateway never exceeds about 10 Gbps, so a requirement of “more than that” or “predictable latency, dedicated” points to ExpressRoute.
High availability designs
| Design | What it gives |
|---|---|
| Active-standby (default) | Two gateway instances, one tunnel active. Failover about 10–15 seconds (planned maintenance 10–15 s, unplanned ~1 minute) |
| Active-active | Both instances have a public IP and a tunnel to the device. Needs BGP for routing symmetry. Better failover and doubles throughput potential |
| Dual redundancy | Active-active on both Azure and the on-premises device (full mesh of four tunnels), using BGP |
| Zone-redundant gateway | AZ SKU. Survives a zone failure |
| VPN as backup for ExpressRoute | Coexisting VPN and ER gateways in the same VNet. ER is preferred when both advertise the same prefix |
The on-premises device must support what you configure. Use BGP for dynamic routing, multiple sites and automatic failover. Azure’s default ASN is 65515. Use a different ASN for your on-premises device. BGP peer addresses on both sides must not overlap with VNet prefixes. For custom APIPA BGP addresses use 169.254.21.0/24 and 169.254.22.0/24.
IPsec/IKE policy
By default Azure negotiates from a list of supported proposals. A custom IPsec/IKE policy pins one combination for a connection, set on both ends (Azure and device). A policy contains:
- IKE phase 1 (main mode): encryption, integrity, DH group, SA lifetime
- IPsec phase 2 (quick mode): encryption, integrity, PFS group, SA lifetime (time and data size)
- Optional UsePolicyBasedTrafficSelectors and DPD timeout
Mismatched proposals are the most common cause of a tunnel stuck in “Connecting”.
Troubleshooting gateways
- Check the connection status (Connected, Connecting, NotConnected) and tunnel metrics (TunnelEgressBytes, TunnelIngressBytes, BGP peer status).
- VPN troubleshoot in Network Watcher runs diagnostics and writes logs to storage.
- Enable gateway diagnostic logs in Log Analytics: GatewayDiagnosticLog, TunnelDiagnosticLog, RouteDiagnosticLog, IKEDiagnosticLog (the last shows negotiation mismatches).
- Frequent causes: wrong pre-shared key; wrong peer public IP in the local network gateway; mismatched IKE/IPsec parameters; on-premises NAT hiding the device without NAT-T support; overlapping address spaces; UDP 500/4500 blocked; the on-premises prefixes missing from the local network gateway; a UDR on GatewaySubnet or an NSG on it.
- Resetting the gateway or resetting the connection helps after changes.
Azure Extended Network
Azure Extended Network stretches an on-premises subnet into an Azure VNet so VMs can move to Azure without changing IP addresses (a migration aid for lift-and-shift and Azure Stack HCI). Layer 2 traffic is bridged over an existing S2S VPN or ExpressRoute connection by a small appliance on-premises and a network virtual appliance in Azure, set up through Windows Admin Center. It’s temporary by design: finish by re-addressing or cutting over the subnet. Don’t use it for a permanent L2 design.
Point-to-site VPN
P2S connects individual clients (laptops) to a VNet. It uses the same route-based VPN gateway (needs GatewaySubnet), plus a client address pool (not overlapping with VNet or on-premises ranges).
SKU selection
P2S supports VpnGw1–5 (and AZ). Basic supports only SSTP/IKEv2 with small numbers and no RADIUS. Larger SKUs allow more concurrent connections: roughly 250 (VpnGw1), 500 (VpnGw2), 1,000 (VpnGw3), 5,000 (VpnGw4) and 10,000 (VpnGw5). SSTP is capped at 128 concurrent connections regardless of SKU. For thousands of remote users, pick VpnGw4/5 with OpenVPN or IKEv2, or use Virtual WAN, whose P2S scale units go higher.
Tunnel types
| Tunnel | Transport | Clients | Notes |
|---|---|---|---|
| OpenVPN | TLS, TCP 443 | Windows, macOS, Linux, iOS, Android | Passes most firewalls. Required for Microsoft Entra ID auth |
| IKEv2 | IPsec, UDP 500 and 4500 | Windows, macOS (native client) | Fast reconnect. Can be blocked by firewalls |
| SSTP | TLS, TCP 443 | Windows only | Max 128 connections |
You can enable more than one tunnel type on the gateway. Combine IKEv2 + OpenVPN to cover Windows, macOS and mobile.
Authentication methods
| Method | Tunnel types | When |
|---|---|---|
| Azure certificate | OpenVPN, IKEv2, SSTP | No directory. Upload the root certificate public key. Each client has a certificate issued by that root. Revoke by thumbprint |
| RADIUS (certificate or password) | OpenVPN, IKEv2, SSTP | Existing NPS/RADIUS with AD. The gateway talks to the RADIUS server (reachable from the GatewaySubnet over VPN/ER). Supports MFA with NPS extension. Needs a shared secret and the server IPs |
| Microsoft Entra ID | OpenVPN only | Users sign in with Entra credentials, Conditional Access and MFA apply. Uses the Azure VPN Client (Windows, macOS, Linux). Configure tenant, audience (app) and issuer on the gateway, and grant admin consent |
Conditional Access, per-user MFA and group-based access point to Entra ID. Existing on-premises AD with NPS points to RADIUS. No identity system and a small team points to certificates. Use Entra ID for the best security posture for remote users.
Client configuration
After you set up the gateway, download the VPN client configuration package from the gateway. It contains profiles per client type, such as azurevpnconfig.xml for the Azure VPN Client and OpenVPN .ovpn data. The package must be regenerated and redistributed when you change the tunnel type, address pool, authentication, DNS or routes. Clients get routes to the VNet and peered VNets, so after peering changes, re-download the profile (or use the Azure VPN Client’s updated profile) to pick up new routes.
Troubleshooting P2S
- Client side: wrong or expired certificate, certificate not in the Current User store, old profile after a gateway change, the machine’s firewall blocking TCP 443 or UDP 500/4500, unsupported OS for the chosen tunnel type, client address pool overlapping the local LAN.
- Authentication: root certificate not uploaded, certificate chain missing, RADIUS server unreachable, shared secret mismatch, Entra app consent missing, wrong tenant in the Azure VPN client.
- Routing: the VNet or peered VNet isn’t reachable because the client profile has stale routes. Enable Use remote gateways and allow gateway transit for peered VNets, then re-download.
- Use the gateway’s P2S connection list, Log Analytics (P2SDiagnosticLog) and client logs.
Always On VPN and Azure Network Adapter
- Always On VPN is the Windows 10/11 feature that auto-connects and can run a device tunnel (before sign-in, machine certificate) and a user tunnel. Azure requirements: route-based gateway, IKEv2 (and for the device tunnel an IKEv2 machine certificate with the root uploaded), VpnGw1+ SKU, and client profiles deployed (Intune or PowerShell). It relies on certificates, not Entra OpenVPN.
- Azure Network Adapter adds a virtual network adapter to an on-premises Windows Server (2019+) through Windows Admin Center, connecting it to a VNet with a P2S VPN. WAC creates the gateway (route-based, P2S with certificate) and the certificate for you. Use it to connect a single server quickly, not a whole site.
ExpressRoute
ExpressRoute gives a private, dedicated connection to Microsoft that doesn’t cross the public internet. It’s chosen for predictable latency, consistent throughput, SLA and security. It isn’t encrypted by default.
Connectivity models
| Model | Description |
|---|---|
| CloudExchange colocation | Virtual cross-connect at an exchange facility |
| Point-to-point Ethernet | Dedicated L2 link from your site to Microsoft |
| Any-to-any (IPVPN) | Your WAN (MPLS) provider integrates Azure as another site |
| ExpressRoute Direct | You connect directly to Microsoft’s global network at a peering location with 10 Gbps or 100 Gbps ports. Supports MACsec, committed capacity, and splitting the ports into many circuits |
Provider circuits come in bandwidths from 50 Mbps to 10 Gbps. A circuit has a service key the provider uses. Each circuit has two connections (primary and secondary) to two Microsoft Enterprise Edge routers (MSEE) for redundancy, and you must use both to get the SLA.
SKUs and billing
| Local | Standard | Premium | |
|---|---|---|---|
| Reach | Only the Azure region(s) in the same metro as the peering location | All regions in the same geopolitical region | Global (any region, any geography) |
| Billing | Unlimited data only | Metered or Unlimited | Metered or Unlimited |
| VNet links | 10 | 10 | Up to 100 (by bandwidth) |
| Routes (private peering) | 4,000 | 4,000 | 10,000 |
| Microsoft 365 | No | No | Yes (with approval) |
Metered = pay per GB egress. Unlimited = flat monthly price. Local is the cheapest when the peering location is near the target region. Premium is needed for cross-geography connectivity, more than 10 VNets, or more than 4,000 routes. You can change the SKU and billing model upward without downtime. A Standard circuit in the same geopolitical area reaches all regions there, such as Europe.
Peering
| Private peering | Microsoft peering | |
|---|---|---|
| Reaches | VNets (private IPs) through an ExpressRoute gateway | Microsoft public services: Microsoft 365, Azure PaaS public endpoints (Storage, SQL) |
| IP addresses | Private (RFC 1918 OK) | Public IPs you own (or provider-supplied), with NAT. Prefixes are validated |
| Subnets | Two /30 subnets (primary and secondary, or /126 for IPv6) | Two /30 subnets, public |
| Filtering | None | Route filter with BGP community values, required to receive any prefixes |
| Auth | VLAN ID, ASN, optional MD5 hash | VLAN ID, ASN, advertised prefixes, optional hash |
Choose between private only, Microsoft only or both: private peering alone for IaaS in VNets. Add Microsoft peering only when you need Microsoft 365 or PaaS public endpoints privately. For Azure PaaS, private endpoints over private peering is the preferred modern answer. Microsoft peering carries more routing and NAT complexity. Public peering is deprecated. Don’t pick it.
Gateway and connecting VNets
- Create an ExpressRoute virtual network gateway in the VNet’s GatewaySubnet (/27 or larger).
- Then create a connection from the gateway to the circuit. Connect VNets in other subscriptions using an authorization key from the circuit owner.
- Gateway SKUs: Standard / ErGw1AZ, High Performance / ErGw2AZ, Ultra Performance / ErGw3AZ, and ErGwScale (scale units, up to the highest throughput). Choose the AZ SKUs for zone resilience. Throughput roughly 1 Gbps (ErGw1Az), 2 Gbps (ErGw2Az), 10 Gbps (ErGw3Az).
- ER and VPN gateways can coexist in the same VNet (one GatewaySubnet).
Route advertisement
- Azure advertises the VNet address space (and peered VNets using gateway transit) to on-premises over BGP. On-premises advertises its prefixes to Azure.
- Private peering limits: 4,000 prefixes from on-premises to Azure (10,000 with Premium). Exceed it and the BGP session drops, so summarize routes.
- Control the preferred path with AS-path prepending and local preference (communities). When both ER and VPN advertise the same prefix, ER wins. When prefixes differ, longest prefix match wins.
- To make traffic symmetric, advertise the same prefix with consistent attributes on both circuits.
- Microsoft peering advertisement requires prefixes you own, or from the provider.
Resilience, cross-region and disaster recovery
- Maximum resiliency: two circuits at different peering locations (with different providers if possible), each with two connections, connected to the same VNet (or via two ER gateways to different regions).
- Cross-region: Premium (or Standard in one geopolitical region) connecting to multiple VNets and regions, or Global Reach. Route to a secondary region through a second circuit or via VNet peering/hub.
- VPN as a backup for ER is a standard cost-conscious DR answer.
- Use zone-redundant gateways (ErGw AZ) and keep a second circuit for provider or location failure. A single circuit has two links but is still a single provider and location.
ExpressRoute options
| Option | What it does | Key conditions |
|---|---|---|
| Global Reach | Connects two on-premises sites through their ExpressRoute circuits over Microsoft’s backbone | Private peering only on both circuits. Different countries or geopolitical regions need Premium. Not in every location |
| FastPath | Sends VNet traffic directly to VMs, bypassing the gateway on the data path for better throughput and latency | Requires ErGw3AZ / Ultra Performance or ErGwScale. Works with ExpressRoute Direct and some providers. Control traffic still uses the gateway. Not supported for some features such as basic load balancer frontends, and has limited support for private endpoints and UDRs on the gateway subnet (check current support) |
| ExpressRoute Direct | Dedicated 10 or 100 Gbps ports, MACsec, circuit sizing flexibility | Use for very high bandwidth, regulatory control or to carve many circuits. Choose when MACsec encryption is a requirement |
Global Reach isn’t for Azure-to-Azure. It’s for on-premises-to-on-premises through Azure. FastPath doesn’t bypass the circuit, only the gateway.
Encryption over ExpressRoute
ExpressRoute isn’t encrypted by default. Options:
| Option | Layer | Where |
|---|---|---|
| MACsec | Layer 2 | Between your edge routers and Microsoft’s, ExpressRoute Direct only. Keys in Azure Key Vault |
| IPsec VPN over ExpressRoute | Layer 3 | S2S VPN over Microsoft peering (public IPs) or private peering (with a gateway in the VNet), end-to-end |
| Application-level TLS | Layer 7 | Always an option |
If a question says “encrypt at the physical link on ER Direct”, answer MACsec. “Encrypt end to end between site and VNet” is IPsec over ER.
BFD
Bidirectional Forwarding Detection detects a failed link quickly so BGP converges in about a second instead of waiting for the BGP hold timer (default keepalive 60 s, hold 180 s). On ExpressRoute, BFD is enabled on the Microsoft side by default for private peering circuits. You must configure it on your router. Without BFD on the customer edge, a silent failure can take minutes to detect.
Diagnosing ExpressRoute
- Check the circuit provisioning state (provider status must be Provisioned) and the circuit state (Enabled).
- Inspect BGP session state, ARP tables and route tables per peering (Get-AzExpressRouteCircuitRouteTable, ARP table).
- Use Network insights and Connection Monitor for end-to-end latency and drops, and Network Watcher next hop for effective paths.
- Common causes: wrong VLAN, ASN or /30 subnets; MD5 mismatch; gateway not linked to the circuit; route limit exceeded; missing route filter on Microsoft peering; provider hasn’t provisioned.
Azure Virtual WAN
Virtual WAN is a managed hub-and-spoke service that gives automated, transitive connectivity between branches, remote users, VNets and ExpressRoute circuits. It replaces hand-built hubs with gateways, Route Server and firewalls.
SKUs
| Basic | Standard | |
|---|---|---|
| S2S VPN | Yes | Yes |
| P2S VPN, ExpressRoute | No | Yes |
| VNet-to-VNet transit, hub-to-hub | No | Yes |
| Azure Firewall in hub (secure hub), NVAs, routing intent | No | Yes |
| Upgrade | Can be upgraded to Standard (one-way) |
Standard is the answer for almost every real design. Basic suits only simple, single-hub, VPN-only sites.
Hubs and components
- A virtual hub is a Microsoft-managed VNet in one region with a hub address prefix (/24 or larger; /23 recommended for scale). You deploy gateways into it: S2S VPN, P2S VPN and ExpressRoute. Hubs can also hold Azure Firewall, NVAs and Route Server-style hub router features.
- Hub-to-hub connectivity is automatic between hubs in the same Virtual WAN (Standard), giving global transit.
- Spokes connect with VNet connections to the hub. Sites connect as VPN sites (a site with links to the hub’s gateways, using IKEv2/BGP or static routes). ExpressRoute circuits connect with a circuit connection.
- The hub router offers up to ~50 Gbps aggregate and BGP peers for NVAs.
Scale units
Capacity is bought in scale units:
| Gateway | 1 scale unit | Maximum |
|---|---|---|
| S2S VPN | 500 Mbps (two instances) | Up to about 20 Gbps aggregate |
| P2S VPN | 500 Mbps and 500 concurrent users | 100 units (about 50 Gbps, 100,000 users) |
| ExpressRoute | 2 Gbps | 10 units (20 Gbps) |
Choose scale units from the aggregate throughput you need, rounding up. Scale units can be changed later and cost by the unit. The hub infrastructure units (routing capacity) are separate and are the minimum 2 (3 Gbps) up to higher counts for more VMs and throughput.
Virtual hub routing
- Every hub has a Default route table (and a None table). Connections are associated with a route table (which table decides their routes) and propagate to one or more route tables or labels (what they advertise).
- Custom route tables isolate spokes (for example shared services vs isolated VNets), using associations and propagations instead of UDRs.
- Static routes in a table or on a VNet connection steer traffic (for example 0.0.0.0/0 to a firewall or NVA).
- Labels group route tables to propagate across hubs.
- Routing intent and routing policies send Internet traffic and/or private traffic through a security solution in the hub (Azure Firewall, NVA or SaaS) without UDRs. This is the simplest way to build a secured hub.
- Virtual WAN routing for spokes avoids UDRs, with the exception of the indirect spoke pattern: a VNet peered to a connected spoke, reached with a static route to the NVA.
Third-party NVA integration
- NVA in the hub: deploy a partner NVA from the Marketplace (for example SD-WAN or next-generation firewall, from Cisco, Fortinet, Barracuda, VMware and others) as a managed application into the hub. The hub handles the branch connectivity with an integrated SD-WAN, and routing is automated.
- NVA in a spoke with BGP peering: the hub router BGP-peers with an NVA in a connected VNet to exchange routes (for example SD-WAN NVA in a “shared services” VNet).
- Azure Firewall in the hub creates a secured hub, managed through Azure Firewall Manager and routing intent.
Virtual WAN vs hub-and-spoke you build
| Requirement | Pick |
|---|---|
| Many branches, global transit, minimal admin, any-to-any | Virtual WAN Standard |
| Spoke-to-spoke through a firewall in a single region, full control, cheapest | Hub VNet + peering + UDRs + Azure Firewall (+ Route Server) |
| Need to host custom NVAs not supported in the hub | Self-managed hub VNet + Route Server |
| Very large P2S user count | Virtual WAN P2S |
| Dozens of VNets with consistent peering/security | Virtual Network Manager (works with either) |
VPN vs ExpressRoute vs Virtual WAN
| Need | Pick |
|---|---|
| Quick, cheap, encrypted over the internet | S2S VPN |
| Remote users or a single machine | P2S VPN (Entra ID for Conditional Access) |
| Predictable latency, high bandwidth, private path | ExpressRoute |
| Reach other geopolitical regions with one circuit | ExpressRoute Premium |
| Connect two on-premises sites over Microsoft’s backbone | ExpressRoute Global Reach |
| Encrypt ER at L2 | ExpressRoute Direct + MACsec |
| Failover for ER | S2S VPN (coexisting) or a second circuit |
| Many branches, automatic transit | Virtual WAN |
Exam checklist
- Route-based VPN supports BGP, IKEv2, P2S, active-active, coexistence. Policy-based only on Basic with IKEv1.
- Active-active needs BGP. Zone-redundant needs AZ SKUs and Standard IPs.
- Local network gateway = on-premises IP + prefixes. Mismatched PSK or IKE policy = tunnel won’t come up.
- P2S: SSTP max 128 and Windows only; Entra ID needs OpenVPN; RADIUS for NPS; certificates for the simple case. Re-download the client package after changes.
- ExpressRoute: Local (metro, unlimited), Standard (geopolitical region), Premium (global, more VNets, more routes).
- Private peering for VNets; Microsoft peering for Microsoft 365 and public endpoints (needs route filter and public prefixes).
- FastPath needs Ultra Performance/ErGw3AZ (or ErGwScale). Global Reach is site to site and private peering only.
- MACsec = ER Direct. IPsec over ER for end-to-end. ER isn’t encrypted by default.
- BFD fails over quickly. Enable on the on-premises router.
- Virtual WAN Standard for transit, ER, P2S, firewall. Scale units: VPN 500 Mbps, ER 2 Gbps.
- Routing intent for a secured hub. Custom route tables for isolation.