Use this when IPsec peers sit behind NAT.
NAT Traversal
ESP → UDP 4500 encapsulation → through NAT
Context & applicabilityCommon mistakes · platform/version boundaries
- UDP 4500 blocked while UDP 500 is allowed.
- NAT device timing out the UDP mapping between keepalives.
- Firewall inspecting IPsec passthrough and breaking NAT-T.
- Remote access clients behind carrier-grade NAT needing IKEv2 with MOBIKE.
Operational reference
Fast context before you go deeper.
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 Checks Verify boundary
- Both peers must allow UDP 4500 as well as UDP 500.
show crypto isakmp sa detailshowsnat-t/Nwhen NAT is detected.- Keepalives (
crypto isakmp nat keepalive 20) keep NAT mappings alive. - ESP (protocol 50) will not be seen on the wire when NAT-T is active — all traffic is UDP 4500.
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.
- NAT-T wraps ESP in UDP 4500.
- Keepalives keep NAT mappings open.
- Firewalls must allow UDP 4500.
tcpdump -ni <if> udp port 4500— NAT-T trafficshow crypto ikev2 sa detailed | include NAT— NAT detected- Firewall rules for UDP 500/4500 — allowed
ReferenceWhy it matters1 section · depth on demand
How it works
1. IKE starts on UDP 500; both peers send NAT-D payloads with hashes of their addresses and ports.
2. If the hashes do not match, NAT is present and IKE moves to UDP 4500.
3. ESP packets are wrapped in UDP 4500 so NAT/PAT can translate them.
4. NAT keepalives (default every 20 s on IOS) keep the NAT mapping open.
Firewalls on the path must allow UDP 500 and 4500.
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 IPsec → NAT Traversal. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4301 · confidence 94%