Use it when IPsec peers do not authenticate or agree on parameters.
IKE
Internet Key Exchange (IKE) authenticates IPsec peers and negotiates the keys and parameters (SAs) for the tunnel, using UDP 500 and UDP 4500 with NAT traversal.
1. IKE negotiates keys and authenticates peers (UDP 500/4500).
2. IKEv1 main/aggressive mode; IKEv2 simpler.
3. Must match proposals, identities, keys/certs.
4. Prefer IKEv2.
5. Debug shows mismatches.
IKE SA → authentication → child/IPsec SAs
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show crypto isakmp saShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification and what it shows Verify boundary
Verify peer identity, IKE SA state, negotiated proposal and authentication result, then confirm the expected child SA and send the original protected flow. An established IKE SA shows control-plane negotiation with that peer, but it does not show the application traffic matches selectors, is encrypted, traverses both directions or reaches its destination.
Step 2 Observation → implication → next check Narrow the fault
Observation → implication → next check: no IKE exchange starts with routing/UDP 500 or NAT-T 4500 reachability. Proposal failure moves to encryption/integrity/DH compatibility. Authentication failure moves to identity, PSK/certificate and trust. IKE established without protected data moves to child-SA selectors, routes and ESP/NAT-T counters.
Step 3 Common mistakes Narrow the fault
- Pre-shared key mismatch or peer identity mismatch.
- UDP 500/4500 blocked by a firewall in the path.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- IKE SA and IPsec child SA are separate evidence boundaries
- Proxy identities/selectors must agree at both peers
- ESP commonly carries protected data; NAT traversal can encapsulate it in UDP 4500
- Encaps and decaps counters must be interpreted with generated interesting traffic and the return path.
show crypto isakmp sa— IKEv1 SAsshow crypto ikev2 sa— IKEv2 SAsdebug crypto ikev2— negotiation (lab)
ReferenceWhy it matters1 section · depth on demand
How it works in operation
IKE authenticates peers and negotiates keying/security parameters used to build IKE and child/IPsec security associations. Peer reachability, proposal compatibility, identity/authentication and child-SA selectors are sequential boundaries; successful IKE does not show ESP data is flowing for the intended protected traffic.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
IKE: authenticating peers and agreeing on keys
The Internet Key Exchange sets up the security associations IPsec uses. RFC 7296 (IKEv2) describes the IKE SA as the protected control channel that holds shared keying state, and Child SAs as the ESP or AH SAs that protect the actual traffic, created under an IKE SA. IKE normally uses UDP port 500, and UDP 4500 for NAT traversal.
What IKE does
| Task | Mechanism |
|---|---|
| Agree on algorithms | Proposals offered by the initiator, one chosen by the responder |
| Create shared keys | Diffie-Hellman exchange |
| Authenticate the peers | Pre-shared keys or digital signatures (certificates) |
| Create IPsec SAs | Child SAs with their own keys and SPIs |
| Keep things alive | Rekeying, and liveness checks (dead peer detection) |
IKEv1 and IKEv2
| IKEv1 | IKEv2 (RFC 7296) | |
|---|---|---|
| Phases | Phase 1 (main or aggressive mode), phase 2 (quick mode) | IKE_SA_INIT and IKE_AUTH; RFC 7296 maps phase 1 to the initial exchanges and phase 2 to CREATE_CHILD_SA |
| Messages to first IPsec SA | 9 (main + quick mode) or 6 (aggressive + quick) | 4 |
| NAT traversal and EAP | Extensions | Part of the protocol |
| Cisco commands | crypto isakmp … | crypto ikev2 … |
R1# show crypto ikev2 sa detailed
IPv4 Crypto IKEv2 SA
Tunnel-id Local Remote fvrf/ivrf Status
1 198.51.100.2/500 203.0.113.2/500 none/none READY
Encr: AES-GCM, keysize: 256, PRF: SHA384, Hash: None, DH Grp:20, Auth sign: PSK, Auth verify: PSK
Life/Active Time: 86400/41522 sec
Local spi: 4B0C9E7F2A11D3C5 Remote spi: 9A12F0C4E8B7D601
Local id: 198.51.100.2
Remote id: 203.0.113.2
DPD configured for 10 seconds, retry 2
R1# show crypto isakmp sa
Authentication (RFC 7296)
AUTH payloads are based on digital signatures or a shared secret. With a shared secret, the identities must match the key used. Certificates scale better and avoid sharing one key among many peers.
Dead peer detection
RFC 7296 says a peer should only be declared dead after repeated unanswered attempts over a timeout period, with exponentially increasing retransmissions, using empty INFORMATIONAL requests. On Cisco, dpd <interval> <retry> on-demand|periodic in the IKEv2 profile controls it.
Documented example, not captured output.
Quick reference
IKE (Internet Key Exchange) is the negotiation phase of IPsec. The two peers authenticate each other, agree on encryption algorithms and securely derive the keys that protect the actual traffic. IKEv2 is the modern version: faster, more robust and better at handling NAT. Most VPN failures happen during IKE, typically because the peers do not agree on algorithms, identities or keys.
IKE negotiates and authenticates IPsec security associations. IKEv2 (RFC 7296) is the current standard: UDP 500, UDP 4500 with NAT traversal, 4 messages for the initial exchange.
crypto ikev2 proposal PROP
encryption aes-gcm-256
prf sha384
group 20
crypto ikev2 policy POL
proposal PROP
crypto ikev2 keyring KR
peer HQ
address 203.0.113.20
pre-shared-key local <key>
crypto ikev2 profile IKEV2-PROF
match identity remote address 203.0.113.20 255.255.255.255
authentication remote pre-share
authentication local pre-share
keyring local KR
show crypto ikev2 sa detailed
Certificates scale better than pre-shared keys for many peers.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Virtualization & Overlays → IPsec → IKE. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4301.html · confidence 94%