Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

Perfect Forward Secrecy

Direct 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.

When to use this

Use this when IPsec should protect past traffic if keys leak.

First 30 seconds

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.

Operational verification

rekey → new DH → independent keys

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • 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).
Platform / version applicability
Network security
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformNetwork security
Scope / prerequisiteUse this when IPsec should protect past traffic if keys leak.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points
  • PFS runs a fresh Diffie-Hellman for each Phase 2 SA.
  • Both peers must agree.
  • It costs a little CPU.
Key checks
  • Phase 2 PFS group configured — pfs
  • show crypto ipsec sa | include PFS — PFS state
  • swanctl --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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
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
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docNetwork security current

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%
Confirmation

Confirm action

Continue?