Security · IPsec
Perfect Forward Secrecy
Cheat sheet · https://pcornel.dk/topic.php?topic=4664
Answer
Perfect forward secrecy (PFS) in IPsec runs a fresh Diffie-Hellman exchange for each Phase 2 SA, so a compromised long-term key cannot decrypt past traffic. Both peers must agree on the PFS group.
Remember
- PFS runs a fresh Diffie-Hellman for each Phase 2 SA.
- Both peers must agree.
- It costs a little CPU.
First checks
- Phase 2 PFS group configured — pfs
show crypto ipsec sa | include PFS— PFS stateswanctl --list-conns | grep esp_proposals— DH in child proposals
Commands
show crypto ipsec sa
Verify in this order
rekey → new DH → independent keys
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=4664