Cisco IOS Site-to-Site IPSec VPN
IKEv1 or IKEv2 site-to-site IPSec VPN tunnel between two Cisco IOS/IOS-XE routers. Generates crypto policy, keyring, profile, transform-set, ACL, and crypto map.
What is it?
IPSec VPN creates an encrypted tunnel between two sites over the public internet. IPSec uses two phases: Phase 1 (IKE) negotiates a secure channel to protect Phase 2. Phase 2 (IPSec) establishes the actual data tunnel. IKEv2 (recommended) is faster, more reliable, and supports features like MOBIKE for mobile clients. The 'interesting traffic' ACL defines which traffic triggers the tunnel — typically the local LAN accessing the remote LAN.
When to use
- ·Site-to-site connectivity between two offices over the internet
- ·Connecting a branch office to HQ without paying for MPLS circuits
- ·Disaster Recovery connectivity between primary and backup data centers
- ·Connecting to cloud providers (AWS, Azure) via VPN Gateway
- ·Partner/vendor connectivity for specific application traffic
When NOT to use
- ·Remote access VPN for individual users — use AnyConnect (SSL VPN) instead, much easier for end users
- ·High-bandwidth real-time traffic (video production) — VPN encryption adds latency and overhead
- ·When SD-WAN is already deployed — SD-WAN typically manages its own overlay tunnels
How it compares
Prerequisites
- →Public IP address on both ends (or NAT traversal configured if behind NAT)
- →Pre-shared key agreed upon between both sites (use certificates for production)
- →Crypto policy parameters must match exactly on both ends (encryption, hash, DH group)
- →Internet connectivity with UDP 500 and UDP 4500 (NAT-T) open between peers
- →ACL defining interesting traffic — must be mirror images on both sides
Config Generator
Verification commands
show crypto ikev2 saVerify IKEv2 Phase 1 is established
ExpectedShows SA state as 'READY'. If empty, Phase 1 never completed.
show crypto ipsec saVerify IPSec Phase 2 tunnels and packet counts
ExpectedShows 'pkts encaps' and 'pkts decaps' incrementing. If they're zero, traffic isn't hitting the tunnel.
show crypto mapShow crypto map configuration and which interfaces it's applied to
ExpectedShows the ACL, peer, and transform-set for each crypto map entry
Debug commands
debug crypto ikev2 errorDebug IKEv2 Phase 1 negotiation errors
WarningModerate output. Check for mismatched proposals or PSK errors. Run 'undebug all' after.
debug crypto ipsec errorDebug Phase 2 errors — transform-set mismatches, PFS issues
WarningUse during maintenance window only.
Common mistakes & fixes
Further learning
Recommended books to go deeper on this topic.
Cisco ASA: All-in-One Next-Gen Firewall, IPS, and VPN Services
Jazib Frahim, Omar Santos, Andrew Ossipov · Cisco Press · Site-to-site IPsec, IKEv1/v2, crypto maps, tunnel interfaces
IKEv2 IPsec Virtual Private Networks — Understanding and Deploying IKEv2, IPsec VPNs, and FlexVPN in Cisco IOS
Graham Bartlett, Amjad Inamdar · Cisco Press · The definitive IKEv2 and FlexVPN reference — crypto fundamentals, keyring, profiles, DVTI, spoke-to-spoke
CCNP Security Virtual Private Networks SVPN 300-730 Official Cert Guide
Joseph Muniz, Steven Chimes, James Risler · Cisco Press · The only Cisco-approved SVPN study guide — covers DMVPN, FlexVPN, GETVPN, AnyConnect, and IKEv2 in depth
Network Security Technologies and Solutions
Yusuf Bhaiji · Cisco Press · CCIE Professional Development · Comprehensive CCIE Security reference — IPsec, IKE, VPN, AAA, PKI, firewalls all in one volume
CCNP and CCIE Security Core SCOR 350-701 Official Cert Guide
Omar Santos · Cisco Press · Required for CCNP/CCIE Security — covers VPN, cryptography, network security architecture