Pcornel
Security · IPsec

ESP

Cheat sheet · https://pcornel.dk/topic.php?topic=4658

Back to the Topic

Answer

ESP (Encapsulating Security Payload, IP protocol 50) encrypts and authenticates IPsec packets. In tunnel mode it protects the whole original packet, and over NAT it is carried in UDP 4500.

Remember

  • ESP is IP protocol 50.
  • Tunnel mode protects the whole original packet.
  • Behind NAT, ESP is carried in UDP 4500.

First checks

  • ip xfrm state | grep -E 'aead|enc|auth' — algorithms
  • show crypto ipsec sa | include encaps|decaps — counters
  • tcpdump -ni <if> esp or udp port 4500 — packets

Commands

show crypto ipsec sa
ip tcp adjust-mss 1360

Verify in this order

payload → ESP encrypt/authenticate → peer decrypts

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=4658

Confirmation

Confirm action

Continue?