How to Set Up Site-to-Site VPNs on Cisco ASA Firewalls: IKEv1 and IKEv2 Configuration

How to Set Up Site-to-Site VPNs on Cisco ASA Firewalls

How to Set Up Site-to-Site VPNs on Cisco ASA Firewalls

Site-to-site VPN is the quiet workhorse connecting branch offices, data centers, and partner networks over the public internet as if they shared a private wire. Cisco ASA has supported this for decades through IPsec, evolving from IKEv1 to the more modern and more capable IKEv2. This guide covers both, how they differ, and how to build a resilient, correctly-troubleshot site-to-site tunnel between two ASAs.

IPsec and IKE Fundamentals

Site-to-site VPN on ASA relies on the IPsec protocol suite, with IKE (Internet Key Exchange) handling the key negotiation and security association setup before any actual encrypted traffic flows. Understanding the phases matters enormously for troubleshooting:

IKEv1 vs. IKEv2 — IKEv2 is not just “IKEv1 version 2,” it’s a redesigned protocol: fewer message exchanges, built-in NAT-T and dead peer detection (DPI) support, better resistance to DoS during negotiation, native support for asymmetric authentication (different auth methods per side), and generally simpler, more robust behavior. New deployments should default to IKEv2 unless a specific legacy requirement forces IKEv1.

Planning Before Configuration

Before touching the CLI, both sides need agreement on:

Configuring Site-to-Site VPN with IKEv2 (Recommended)

Step 1: Enable IKEv2 on the Outside Interface

enable
configure terminal
crypto ikev2 enable outside

Step 2: Define the IKEv2 Policy (Phase 1 parameters)

crypto ikev2 policy 10
 encryption aes-256
 integrity sha256
 group 14
 prf sha256
 lifetime seconds 86400

Step 3: Define the IPsec Proposal (Phase 2 parameters)

crypto ipsec ikev2 ipsec-proposal AES256-SHA256
 protocol esp encryption aes-256
 protocol esp integrity sha-256

Step 4: Define Interesting Traffic (Crypto ACL)

object network LOCAL-NET
 subnet 10.1.1.0 255.255.255.0
object network REMOTE-NET
 subnet 10.2.1.0 255.255.255.0

access-list VPN-TO-BRANCH2 extended permit ip object LOCAL-NET object REMOTE-NET

Step 5: NAT Exemption

nat (inside,outside) source static LOCAL-NET LOCAL-NET destination static REMOTE-NET REMOTE-NET no-proxy-arp route-lookup

Step 6: Configure the Tunnel Group (Peer Identity and PSK)

tunnel-group 198.51.100.10 type ipsec-l2l
tunnel-group 198.51.100.10 ipsec-attributes
 ikev2 remote-authentication pre-shared-key MyStrongSharedKey123!
 ikev2 local-authentication pre-shared-key MyStrongSharedKey123!

Step 7: Create the Crypto Map and Bind It

crypto map OUTSIDE-MAP 10 match address VPN-TO-BRANCH2
crypto map OUTSIDE-MAP 10 set peer 198.51.100.10
crypto map OUTSIDE-MAP 10 set ikev2 ipsec-proposal AES256-SHA256
crypto map OUTSIDE-MAP 10 set pfs group14
crypto map OUTSIDE-MAP interface outside

PFS (Perfect Forward Secrecy) forces a fresh Diffie-Hellman exchange for Phase 2 independent of the Phase 1 key material — a security best practice worth enabling, at a small computational cost.

Step 8: Mirror the Configuration on the Peer ASA

The remote-side ASA needs the mirror image — swapped local/remote subnets, swapped peer IP, matching PSK, and matching Phase 1/Phase 2 parameters. IKE negotiation will fail if the two sides don’t agree on proposed encryption/hash/DH parameters, so keep these identical on both ends.

Configuring Site-to-Site VPN with IKEv1 (Legacy)

Still common in older deployments or when interoperating with third-party gear that hasn’t been upgraded:

crypto isakmp enable outside
crypto isakmp policy 10
 authentication pre-share
 encryption aes-256
 hash sha256
 group 14
 lifetime 86400

crypto ipsec transform-set TS-AES256-SHA esp-aes-256 esp-sha-hmac

tunnel-group 198.51.100.10 type ipsec-l2l
tunnel-group 198.51.100.10 ipsec-attributes
 pre-shared-key MyStrongSharedKey123!

access-list VPN-TO-BRANCH2 extended permit ip object LOCAL-NET object REMOTE-NET

crypto map OUTSIDE-MAP 10 match address VPN-TO-BRANCH2
crypto map OUTSIDE-MAP 10 set peer 198.51.100.10
crypto map OUTSIDE-MAP 10 set transform-set TS-AES256-SHA
crypto map OUTSIDE-MAP 10 set pfs group14
crypto map OUTSIDE-MAP interface outside

Note IKEv1’s crypto isakmp policy versus IKEv2’s crypto ikev2 policy — the commands are structurally similar but not interchangeable, and mixing them on the same tunnel is not how a peer relationship is defined (each peer/tunnel picks one IKE version).

Verification

Check Phase 1 (IKE SA) Status

show crypto ikev2 sa

Expected healthy output:

IKEv2 SA Database
Session-id: 1, Status: ESTABLISHED, IKE count: 1, CHILD count: 1
Local: 203.0.113.1/500  Remote: 198.51.100.10/500  ...

For IKEv1:

show crypto isakmp sa

Check Phase 2 (IPsec SA) Status

show crypto ipsec sa

Look for non-zero pkts encaps/pkts decaps counters — Phase 2 SA existing but zero packet counts usually indicates the tunnel is up but no traffic is actually being routed into it (a routing or interesting-traffic ACL mismatch, not a crypto negotiation problem).

Confirm Interesting Traffic Actually Triggers the Tunnel

packet-tracer input inside icmp 10.1.1.5 8 0 10.2.1.5

This simulates a packet and shows exactly which policy/route/crypto map decision it would hit — extremely useful for validating without needing live production traffic.

Real-World Deployment Scenario

Scenario: A company with a headquarters and three branch offices needs full-mesh-equivalent connectivity for file sharing and VoIP, but wants to avoid the O(n²) complexity of a literal full mesh as they add branches.

Design:

Common Configuration Mistakes

Troubleshooting Site-to-Site VPN

SymptomLikely CauseDiagnostic Commands
Phase 1 never establishesPeer IP wrong, PSK mismatch, or Phase 1 parameter mismatchdebug crypto ikev2 protocol, show crypto ikev2 sa, confirm identical policy on both peers
Phase 1 up, Phase 2 failsCrypto ACL mismatch (asymmetric permit statements), transform-set/proposal mismatchdebug crypto ipsec, compare crypto ACLs on both sides line by line
Tunnel up but no traffic passesNAT exemption missing, routing not pointing traffic at the tunnel, or crypto map ACL doesn’t match actual trafficpacket-tracer, show crypto ipsec sa (check encaps/decaps counters), verify NAT exemption and routing table
Tunnel flaps intermittentlyDPD misconfigured/too aggressive, unstable underlying internet path, or NAT-T keepalive issues through a NAT deviceshow crypto ikev2 sa detail, tune DPD interval, verify NAT-T (crypto ikev2 nat-traversal) is functioning through any intermediate NAT
Works one direction, not the otherAsymmetric crypto ACL, or asymmetric routing sending return traffic a different path that bypasses the tunnelVerify both peers’ ACLs are true mirrors; check routing tables on both ends
Overlapping subnet conflictBoth sites use the same private range internallyRedesign addressing, or use NAT within the VPN tunnel (more complex, generally a last resort)
debug crypto ikev2 protocol 127
debug crypto ikev2 platform 127
show crypto ikev2 sa detail
show crypto ipsec sa
clear crypto ikev2 sa
clear crypto ipsec sa

clear crypto ikev2 sa and clear crypto ipsec sa are commonly used to force renegotiation after a config change — a stale SA won’t automatically pick up new parameters without a clear or a natural lifetime expiration.

Security Best Practices

Performance Tuning

Frequently Asked Questions

Should I use IKEv1 or IKEv2 for a new site-to-site VPN? IKEv2, unless a specific peer device only supports IKEv1. IKEv2 is more efficient, more secure by design, and has native support for features IKEv1 needed vendor-specific workarounds for (like NAT-T and DPD).

What causes a tunnel to show “up” but pass zero traffic? Almost always a NAT exemption or routing issue, not a crypto/negotiation problem — the Phase 1/Phase 2 SAs can be perfectly healthy while traffic simply never gets routed into the tunnel in the first place. packet-tracer and checking encaps/decaps counters are the fastest way to isolate this.

Can I have overlapping subnets between two sites in a site-to-site VPN? Not without significant NAT complexity layered into the VPN design — the cleanest fix is always non-overlapping addressing during network design; retrofitting NAT-over-VPN for overlapping subnets is achievable but adds real operational complexity.

What’s the difference between policy-based (crypto map) and route-based (VTI) site-to-site VPN? Policy-based VPN uses a crypto ACL to define exactly which traffic gets encrypted, tied to a crypto map. Route-based VPN (VTI) creates a virtual tunnel interface that any routed traffic can traverse based on the routing table, allowing dynamic routing protocols to run over the tunnel — generally simpler to scale for complex, multi-subnet, multi-site topologies.

How do I tell if a Phase 1 failure is due to a PSK mismatch versus a parameter mismatch? debug crypto ikev2 protocol output typically distinguishes between authentication failures (PSK/certificate mismatch) and proposal negotiation failures (no matching encryption/hash/DH combination) — read the debug output carefully rather than guessing, since the fix differs completely between the two.

Summary

Site-to-site VPN on Cisco ASA comes down to getting both IKE phases to agree — matching Phase 1 authentication and crypto parameters, matching Phase 2 transform sets, and mirrored interesting-traffic definitions on both peers — combined with correct NAT exemption and routing so negotiated tunnels actually carry real traffic. IKEv2 should be the default choice for new deployments given its efficiency and security improvements over IKEv1, and disciplined verification (show crypto ikev2 sa, show crypto ipsec sa, packet-tracer) turns what can feel like an opaque negotiation process into a methodical, diagnosable one. Build it with PFS, strong algorithms, and DPD from the start, and a site-to-site tunnel becomes exactly what it should be: an invisible, reliable extension of your private network.

References

Exit mobile version