Security · IPsec
NAT Traversal
Cheat sheet · https://pcornel.dk/topic.php?topic=4665
Answer
NAT traversal (NAT-T) detects NAT between IPsec peers and wraps ESP in UDP port 4500, because NAT devices cannot translate raw ESP packets. Keepalives hold the NAT mapping open.
Remember
- NAT-T wraps ESP in UDP 4500.
- Keepalives keep NAT mappings open.
- Firewalls must allow UDP 4500.
First checks
tcpdump -ni <if> udp port 4500— NAT-T trafficshow crypto ikev2 sa detailed | include NAT— NAT detected- Firewall rules for UDP 500/4500 — allowed
Commands
show crypto isakmp sa detail
Verify in this order
ESP → UDP 4500 encapsulation → through NAT
Where it usually breaks
First mismatch in endpoint/identity → path/reachability → policy selection → enforcement/session → protected flow → telemetry/detection; preserve identity/policy/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4665