Use this when choosing Diffie-Hellman groups for IPsec.
Diffie-Hellman Groups
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.
1. DH groups set key exchange strength.
2. Use 19/20 (ECP-256/384), 21, 31 (Curve25519), or 14+ MODP (2048-bit).
3. Avoid 1, 2, 5.
4. Same group for PFS.
5. Post-quantum hybrids emerging (RFC 9370).
DH group → shared secret → keys
Context & applicabilityCommon mistakes · platform/version boundaries
- DH groups 1, 2 and 5 still allowed (768–1536-bit MODP — too weak).
- Phase 1 and PFS groups differing between peers.
- Choosing very large MODP groups (group 16+) on low-end hardware, causing slow rekeys.
- Prefer ECP groups 19/20 or group 21; group 14 (2048-bit) is the minimum MODP.
Operational reference
Fast context before you go deeper.
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.
- Use groups 19, 20, 21 or at least 14.
- Groups 1, 2, 5 are obsolete.
- Both peers must match.
- IKE proposal DH group — 14, 19, 20, 21, 31
show crypto ikev2 sa detailed | include DH— negotiated groupswanctl --list-sas— ECP/MODP group
ReferenceWhy it matters1 section · depth on demand
Groups
| Group | Type | Status |
|---|---|---|
| 1, 2, 5 | 768–1536-bit MODP | Broken / do not use |
| 14 | 2048-bit MODP | Minimum acceptable |
| 15, 16 | 3072/4096-bit MODP | Strong but slow |
| 19, 20, 21 | 256/384/521-bit ECP | Recommended |
Use the same DH group for PFS in Phase 2.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Diffie-Hellman (DH) groups define the mathematical group used for key exchange in IKE and PFS. Stronger groups protect against an attacker who records traffic and tries to derive the keys later.
| Group | Type | Status |
|---|---|---|
| 1, 2, 5 | MODP 768/1024/1536 | Weak — remove |
| 14 | MODP 2048 | Minimum acceptable |
| 15, 16 | MODP 3072/4096 | Strong, slower |
| 19, 20, 21 | ECP 256/384/521 | Recommended |
| 31 | Curve25519 | Recommended where supported |
Both peers must agree on the group in IKE and, if PFS is used, in phase 2/child SAs. DH group mismatch in PFS settings is a classic reason a tunnel establishes phase 1 but fails at rekey.
ReferenceConfiguration & state1 section · depth on demand
Configuration examples
# strongSwan
ike=aes256gcm16-prfsha384-ecp384
# Cisco IOS XE
crypto ikev2 proposal P1
group 20 19
Documented example, not captured output. Group 31 (Curve25519) is supported on many newer platforms; check both peers before using it.
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 → Diffie-Hellman Groups. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4301 · confidence 94%