Site-to-Site IPsec IKEv2 Route-Based VPN Tunnel Deployment
Before you begin
- Applies to:Route-based site-to-site VPN deployment using IPsec and IKEv2.
- Where to start:Start with the management consoles for both VPN peers and coordinate the change between sites.
- What you need:Have approved peer addresses, routed prefixes, authentication material, and the agreed IKE and IPsec settings.
Guide tools
Scope, Architecture & Modern Cryptographic Baseline
Connecting enterprise branches, remote corporate sites, and cloud providers (Azure / AWS) requires secure, high-throughput encrypted tunnels.
This procedure establishes a Route-Based Virtual Tunnel Interface (VTI) utilizing IKEv2. Unlike legacy policy-based VPNs, route-based tunnels decouple encryption from traffic selectors, treating the tunnel as a native routable interface.
Cryptographic Baseline Specification (NIST / NSA Suite B Compliant)
| Phase Parameter | Enterprise Standard Baseline | Legacy Insecure (STRICTLY BANNED) |
|---|---|---|
| IKE Protocol | IKEv2 (Strictly enforced) | IKEv1 (Banned) |
| Phase 1 Encryption | AES-256-GCM (or AES-256-CBC) | 3DES, DES, Blowfish |
| Phase 1 Hash / PRF | SHA-384 (or SHA-256) | MD5, SHA-1 |
| Diffie-Hellman Group | Group 19 (ECP-256) or Group 21 (ECP-384) | Group 1, Group 2, Group 5 |
| Phase 2 Encryption | AES-256-GCM (Integrated Auth) | 3DES, NULL |
| Perfect Forward Secrecy | PFS Enabled (DH Group 19 / 21) | PFS Disabled |
| Dead Peer Detection (DPD) | Enabled (Periodic 10s, Retry 3) | DPD Disabled |
Reference Interconnect Topology
| Parameter | Headquarters (HQ) | Branch Office (BR) |
|---|---|---|
| Public Gateway IP | 198.51.100.1 | 203.0.113.1 |
| Internal Subnet | 10.10.0.0/16 (Site 10) | 10.20.0.0/16 (Site 20) |
| Tunnel P2P Subnet | 172.16.255.1 / 30 | 172.16.255.2 / 30 |
| Pre-Shared Key (PSK) | Cryptographically random 32+ character secret |
Implementation Path A: Fortinet FortiGate (FortiOS)
Configure on the Headquarters FortiGate via CLI:
Configure Phase 1 (IKEv2 Proposal)
FortiOS Phase 1Define the IKEv2 Phase 1 interface with AES-256-GCM encryption, SHA-384 PRF, and Diffie-Hellman groups 19 and 21.
config vpn ipsec phase1-interface edit "VPN-TO-BRANCH01" set interface "wan1" set ike-version 2 set keylife 86400 set peertype any set net-device disable set proposal aes256gcm-prfsha384 aes256-sha384 set dpd on-idle set dpd-retryinterval 10 set dhgrp 19 21 set remote-gw 203.0.113.1 set psksecret "SuperSecretRandom32CharPreSharedKey!" nextendConfigure Phase 2 (IPsec VTI Interface)
FortiOS Phase 2Configure the Phase 2 selector with AES-256-GCM and wildcard 0.0.0.0 traffic selectors to enable route-based encapsulation.
config vpn ipsec phase2-interface edit "VPN-TO-BRANCH01-P2" set phase1name "VPN-TO-BRANCH01" set proposal aes256gcm set dhgrp 19 21 set keylifeseconds 28800 set src-subnet 0.0.0.0 0.0.0.0 set dst-subnet 0.0.0.0 0.0.0.0 nextendAssign IP to Tunnel Interface & Create Static Route
FortiOS RoutingAssign point-to-point IP addresses to the tunnel virtual interface and define a static route targeting the remote branch network.
config system interface edit "VPN-TO-BRANCH01" set ip 172.16.255.1 255.255.255.255 set remote-ip 172.16.255.2 255.255.252 set allowaccess ping nextend
config router static edit 102 set dst 10.20.0.0 255.255.0.0 set device "VPN-TO-BRANCH01" nextendConfigure Bi-Directional Firewall Policies
FortiOS PolicyCreate firewall rules permitting traffic flow between the local internal server/user networks and the remote VPN tunnel interface.
config firewall policy edit 201 set name "LAN-TO-BRANCH-IPSEC" set srcintf "vlan20-servers" "vlan30-users" set dstintf "VPN-TO-BRANCH01" set srcaddr "all" set dstaddr "all" set action accept set schedule "always" set service "ALL" next edit 202 set name "BRANCH-TO-LAN-IPSEC" set srcintf "VPN-TO-BRANCH01" set dstintf "vlan20-servers" set srcaddr "all" set dstaddr "all" set action accept set schedule "always" set service "ALL" nextendImplementation Path B: Cisco IOS-XE Router / Firewall
Configure on Cisco IOS-XE router at Headquarters:
Configure IKEv2 Proposal & Keyring
Cisco IKEv2Define the IKEv2 crypto proposal, policy, pre-shared key keyring, and identity match profile on Cisco IOS-XE.
configure terminal
crypto ikev2 proposal PROP-IKEV2-SECURE encryption aes-gcm-256 prf sha384 group 19exit
crypto ikev2 policy POL-IKEV2-SECURE proposal PROP-IKEV2-SECUREexit
crypto ikev2 keyring KEYRING-BRANCH01 peer BRANCH01 address 203.0.113.1 pre-shared-key SuperSecretRandom32CharPreSharedKey! exitexit
crypto ikev2 profile PROF-IKEV2-BRANCH01 match identity remote address 203.0.113.1 255.255.255.255 authentication remote pre-share authentication local pre-share keyring local KEYRING-BRANCH01 dpd 10 3 on-demandexitConfigure IPsec Transform-Set & Profile
Cisco IPsecCreate the ESP-GCM-256 transform set in transport mode and bind it to the IPsec profile with Perfect Forward Secrecy (PFS Group 19).
crypto ipsec transform-set TS-AES256-GCM esp-gcm 256 mode transportexit
crypto ipsec profile PROF-IPSEC-VTI set transform-set TS-AES256-GCM set ikev2-profile PROF-IKEV2-BRANCH01 set pfs group19exitConfigure Virtual Tunnel Interface (VTI) & Routing
Cisco VTIDefine the Tunnel interface, protect it with the IPsec profile, and add a static route directing branch traffic into the tunnel.
interface Tunnel100 description VTI-TO-BRANCH01 ip address 172.16.255.1 255.255.255.252 tunnel source GigabitEthernet0/0/0 tunnel mode ipsec ipv4 tunnel destination 203.0.113.1 tunnel protection ipsec profile PROF-IPSEC-VTI exit
ip route 10.20.0.0 255.255.0.0 Tunnel100write memoryImplementation Path C: pfSense / OPNsense Firewall
Configure Phase 1 & Routed VTI Phase 2
pfSense IKEv2In VPN â IPsec â Tunnels, configure IKEv2 Phase 1 with AES-GCM (256 bits), PRF SHA384, DH Group 19, and create a Routed (VTI) Phase 2.
Phase 1:- Key Exchange version: IKEv2- Interface: WAN- Remote Gateway: 203.0.113.1- Encryption: AES-GCM (256 bits) | PRF: SHA384 | DH Group: 19 (256-bit ECP)- Lifetime: 86400 | DPD: Enable (Delay 10, Retries 3)
Phase 2 (Routed VTI):- Mode: Routed (VTI)- Local Network: 172.16.255.2/30 | Remote Network: 172.16.255.1/30- Protocol: ESP | Encryption: AES256-GCM | PFS Group: 19Assign Interface & Create Static Route
pfSense RoutingAssign the new ipsec VTI interface, configure the gateway, add a static route for the headquarters network, and allow IPsec traffic.
1. Interfaces -> Assignments: Assign the new ipsec VTI interface.2. System -> Routing -> Gateways: Verify gateway 172.16.255.1.3. System -> Routing -> Static Routes: Route 10.10.0.0/16 via 172.16.255.1.4. Firewall -> Rules -> IPsec: Add pass rule for required corporate traffic.Operational Verification & Emergency Rollback Procedure
Validate Phase 1 / Phase 2 SAs & Ping Across VTI
VerificationVerify security associations across both gateways and confirm bidirectional ping reachability over the encrypted tunnel interface.
# On Fortinet FortiGate:diagnose vpn ike gateway list name "VPN-TO-BRANCH01"diagnose vpn tunnel list name "VPN-TO-BRANCH01-P2"
# On Cisco IOS-XE:show crypto ikev2 sashow crypto session detail
# Ping validation across tunnel:ping 172.16.255.2 source 172.16.255.1Administrative Tunnel Shutdown & Debug Isolation
RollbackIf an unstable tunnel flaps continuously, administratively disable the Phase 1 interface and inspect debug logs for mismatched cryptographic proposals.
# On FortiGate:config vpn ipsec phase1-interface edit "VPN-TO-BRANCH01" set status disable end
# On Cisco IOS-XE:interface Tunnel100 shutdown
# Debug proposal mismatches:# FortiOS: diagnose debug application ike -1# Cisco: debug crypto ikev2Your feedback keeps these production procedures accurate and battle-tested.