Pcornel
Security · IPsec

Diffie-Hellman Groups

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

Back to the Topic

Answer

Diffie-Hellman groups set the strength of IPsec key exchange. Use group 19, 20 or 21 (elliptic curve) or at least group 14 (2048-bit MODP); groups 1, 2 and 5 are obsolete.

Remember

  • Use groups 19, 20, 21 or at least 14.
  • Groups 1, 2, 5 are obsolete.
  • Both peers must match.

First checks

  • IKE proposal DH group — 14, 19, 20, 21, 31
  • show crypto ikev2 sa detailed | include DH — negotiated group
  • swanctl --list-sas — ECP/MODP group

Verify in this order

DH group → shared secret → 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=4663

Confirmation

Confirm action

Continue?