Azure Site-to-Site VPN
Azure Site-to-Site VPN — Detailed Resource-by-Resource Creation
This explains exactly how every Azure resource is created, what it does, where it resides, and how all components connect in Microsoft Azure.
On-Prem Network (192.168.1.0/24)
|
[Firewall/VPN Device]
|
Public IP: 1.2.3.4
|
================ INTERNET =================
|
Azure VPN Gateway (Public IP)
|
GatewaySubnet
|
Azure VNet (10.0.0.0/16)
|
┌──────────────┬──────────────┐
| | |
AppSubnet DBSubnet WebSubnet
10.0.1.0/24 10.0.2.0/24 10.0.3.0/24
๐️ STEP 1 — CREATE RESOURCE GROUP
| Field | Value |
|---|---|
| Resource Group | RG-Network-Prod |
| Region | Central India |
๐ Why first?
Every Azure resource must belong to a resource group.
๐งฑ STEP 2 — CREATE VIRTUAL NETWORK (VNet)
๐ What it is
The VNet is the private Azure network.
Equivalent to:
- Corporate network
- Data center network
๐ง Portal Steps
Go to:
Virtual Networks
→ Create
Field Example Name Prod-VNet Region Central India IP Address Tab
Address Space
Example:
10.0.0.0/16Meaning:
- Entire VNet range
- Supports many subnets
๐ Why /16?
Allows many subnet allocations later.
| Subnet | Purpose |
|---|---|
| WebSubnet | Web servers |
| AppSubnet | APIs |
| DBSubnet | Databases |
| GatewaySubnet | VPN gateway |
๐ STEP 4 — CREATE GATEWAYSUBNET (VERY IMPORTANT)
๐ What it is
Special subnet used ONLY for:
- VPN Gateway
- ExpressRoute Gateway
| Field | Value |
|---|---|
| Name | GatewaySubnet |
| Range | 10.0.255.0/27 |
๐ Why /27?
VPN gateways need multiple IPs internally.
⚠️ NEVER place:
- VMs
- Firewalls
- Apps
inside GatewaySubnet.
๐ STEP 5 — CREATE PUBLIC IP FOR VPN GATEWAY
๐ What it is
Azure VPN Gateway needs public internet visibility.
๐ง Portal Steps
Go to:
Public IP Addresses
→ Create
Field Value Name VPNGW-PIP SKU Standard Assignment Static ๐ Why Static?
VPN endpoint must not change IP.
๐ฐ️ STEP 6 — CREATE VIRTUAL NETWORK GATEWAY
๐ What it is
This is the actual Azure VPN appliance managed by Microsoft.
It:
- Terminates VPN tunnels
- Encrypts traffic
- Routes packets into VNet
๐ง Portal Steps
Go to:
Virtual Network Gateway
→ Create
Field Value Name Prod-VPNGW Gateway Type VPN VPN Type Route-based SKU VpnGw1 Generation Gen2 VNet Prod-VNet Public IP VPNGW-PIP ๐ Route-based vs Policy-based
Route-based (recommended)
Uses routing table logic.
Supports:
- BGP
- Modern VPNs
- Better scalability
๐ Deployment Time
Usually:
30–45 minutes
๐ข STEP 7 — CREATE LOCAL NETWORK GATEWAY๐ What it represents
Represents ON-PREMISES network in Azure.
๐ง Portal Steps
Go to:
Local Network Gateway
→ Create
Field Example Name HQ-OnPrem Public IP 1.2.3.4 Address Space 192.168.1.0/24 ๐ Meaning
Tells Azure:
๐ STEP 8 — CREATE VPN CONNECTION
- Where on-prem VPN device exists
- Which network is behind it
๐ What it is
Creates IPsec tunnel relationship.
๐ง Portal Steps
Go to:
Connections
→ Add
Field Value Connection Type Site-to-site (IPsec) VNet Gateway Prod-VPNGW Local Network Gateway HQ-OnPrem Shared Key (PSK) MySecret123 ๐ What PSK is
Shared secret used for:
- Authentication
- Tunnel encryption
๐ฅ STEP 9 — CONFIGURE ON-PREM VPN DEVICE
๐ What happens here
Configure:
- Firewall/router
- VPN tunnel
- IPsec policies
Example Devices
- Cisco ASA
- Palo Alto
- Fortinet
- pfSense
๐ฅ Example Scenario (Very Common in Companies)Here’s a real-world, most commonly used example of a Site-to-Site VPN setup between a branch office FortiGate and Microsoft Azure.
This is basically what you’ll see in many production environments.
Side Details On-prem branch office FortiGate firewall Azure VNet 10.20.0.0/16 Office LAN 192.168.10.0/24 Azure VPN Gateway IP 52.172.45.10 Pre-shared key Forti@2026Secure!⚙️ STEP-BY-STEP (REALISTIC CONFIG)
STEP 1 — Create VPN Tunnel
On FortiGate:
VPN → IPsec Tunnels → Create New → Custom
Tunnel name: AZURE-S2S
STEP 2 — Set Azure Public IP
Remote Gateway: Static IP IP Address: 52.172.45.10
This is the Azure VPN Gateway public IP.STEP 3 — Set Authentication
Authentication Method: Pre-shared Key
Key: Forti@2026Secure!This must match Azure exactly.
Internet Key Exchange
STEP 4 — Configure IKE Phase 1 (MOST COMMON STANDARD)
This is what 80% of companies use:
Setting Value IKE Version IKEv2 Encryption AES256 Authentication SHA256 DH Group 14 Lifetime 28800 STEP 5 — Configure IPsec Phase 2
Setting Value Local Subnet 192.168.10.0/24 Remote Subnet 10.20.0.0/16 Encryption AES256 Authentication SHA256 PFS Enabled DH Group 14 Lifetime 3600 STEP 6 — Create Routes (VERY IMPORTANT)
Network → Static Routes → Create New
Field Value Destination 10.20.0.0/16 Gateway IPsec tunnel (AZURE-S2S) STEP 7 — Firewall Policies
LAN → Azure
- Source: 192.168.10.0/24
- Destination: 10.20.0.0/16
- NAT: ❌ Disabled
- Service: ALL
- Action: ACCEPT
Azure → LAN
- Source: 10.20.0.0/16
- Destination: 192.168.10.0/24
- NAT: ❌ Disabled
- Action: ACCEPT
STEP 8 — Bring Tunnel UP
VPN → IPsec Monitor → Bring UpExpected status:
Tunnel: UP
Comments
Post a Comment