Use this when IPsec should protect past traffic if keys leak.
Perfect Forward Secrecy
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.
1. PFS makes each child SA use a fresh DH exchange.
2. Compromise of one key doesn't expose others.
3. Enable with strong groups.
4. Both peers must agree.
5. Slight CPU cost at rekey.
rekey → new DH → independent keys
Context & applicabilityCommon mistakes · platform/version boundaries
- PFS enabled on one peer only — phase 2 fails or falls back.
- Different PFS group from the phase 1 group without both sides configured.
- Assuming PFS is on by default (it is not on many platforms).
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
PFS group mismatches show as phase 2 failures while phase 1 is up. On Cisco IOS: show crypto ipsec sa shows PFS (Y/N): Y, DH group: group19; on strongSwan the child SA proposal includes the DH group (esp=aes256gcm16-ecp384).
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.
- PFS runs a fresh Diffie-Hellman for each Phase 2 SA.
- Both peers must agree.
- It costs a little CPU.
- Phase 2 PFS group configured — pfs
show crypto ipsec sa | include PFS— PFS stateswanctl --list-conns | grep esp_proposals— DH in child proposals
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Perfect Forward Secrecy (PFS) performs a fresh Diffie-Hellman exchange for each new IPsec SA, so the keys protecting traffic are independent of the long-term IKE keys. If an attacker later obtains the IKE keys or the pre-shared key, they still cannot decrypt previously recorded traffic.
crypto ipsec profile VPN-PROF
set pfs group20
Cost: an extra DH computation per rekey — negligible on modern hardware. Both peers must have PFS enabled with the same group; a mismatch often appears only at the first rekey (typically after an hour), causing tunnels that drop periodically. Enable PFS on all site-to-site tunnels.
Why PFS matters
Without PFS, phase 2 keys are derived from the phase 1 key material. If that is later compromised, recorded traffic can be decrypted. With PFS, each phase 2 rekey runs a new Diffie-Hellman exchange, so one compromised key exposes only one SA's traffic.
ReferenceConfiguration & state1 section · depth on demand
Configuration
crypto ipsec profile IPSEC
set transform-set TS
set pfs group20
Documented example, not captured output. Both peers must agree on PFS and group, or Phase 2 fails while Phase 1 is up. PFS costs a little CPU at each rekey but protects old traffic if a key is stolen later.
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 → Perfect Forward Secrecy. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4301 · confidence 94%