Choosing IPsec proposals: what to use and what to retire

AES-GCM or AES-CBC, SHA-256 or SHA-384, group 14 or 20, PFS and lifetimes: what to pick for a new IPsec tunnel, and how to line up proposals between vendors.

IKEv2 proposals · example# IKE (phase 1)encryption aes256prf sha384dh-group 20 (ecp384)# ESP (phase 2)encryption aes256gcm16pfs-group 20AES-256SHA-256/384DH 19 · 20PFS3DESMD5SHA-1DH 2 · 5use · retire

The short answer

For a new IPsec tunnel, use IKEv2 with AES-256 encryption, SHA-256 or SHA-384 for integrity and the PRF, and Diffie-Hellman group 19 or 20 (or group 14 for older peers). Turn on PFS for the child SAs with the same group. Retire DES, 3DES, MD5, SHA-1 and DH groups 1, 2 and 5 wherever you still find them.

The exact choice matters less than one rule: both peers must offer at least one identical proposal. Most "IPsec encryption" problems are not weak algorithms but two ends that don't match, which fails with NO_PROPOSAL_CHOSEN.

What an IPsec proposal contains

A proposal is a set of algorithms the peers offer each other. There are two kinds, negotiated at different times:

  • The IKE proposal (phase 1) protects the IKE SA itself: encryption, integrity, a pseudo-random function (PRF) for deriving keys, and a Diffie-Hellman group.
  • The ESP proposal (phase 2) protects your traffic: encryption, integrity and, if PFS is on, a Diffie-Hellman group for each rekey.

Each side can list several proposals in order of preference. The responder picks the first one it supports. The algorithm requirements are maintained by the IETF in RFC 8247 for IKEv2 and RFC 8221 for ESP, and those documents are the best reference when vendors disagree.

IPsec encryption algorithms

AES is the standard cipher for IPsec. It comes in two families:

  • AES-CBC (for example AES-256-CBC) encrypts only, so it needs a separate integrity algorithm such as HMAC-SHA-256. It is supported by every device made in the last twenty years.
  • AES-GCM is an authenticated cipher (AEAD): it encrypts and checks integrity in one step, so no separate integrity algorithm is configured for ESP. It is fast on modern hardware, but older devices may not offer it, and some only support it for ESP and not for IKE.

Both 128-bit and 256-bit keys are considered secure. AES-256 is the common choice for new tunnels and is required by some compliance frameworks; AES-128 is acceptable where a peer is short on CPU. ChaCha20-Poly1305 is also standardised and useful on hardware without AES acceleration, but support is far from universal. DES and 3DES should be removed: their 64-bit block size makes long-lived tunnels vulnerable.

Integrity and PRF

With AES-CBC you need an integrity algorithm, and IKE always needs a PRF. Use SHA-256, SHA-384 or SHA-512 (sha2_256, sha2_384, sha2_512 in strongSwan; prf sha256 on Cisco). Retire MD5 and SHA-1; many current releases already disable them by default. A detail that catches people out: with AES-GCM in IKE, the integrity field is empty, but the PRF is still required, and both sides must pick the same one.

Diffie-Hellman groups

The Diffie-Hellman group sets the strength of the key exchange, and is the setting that differs most often between vendors because each uses its own default.

GroupTypeUse it?
1, 2, 5MODP 768, 1024, 1536-bitNo, retire
14MODP 2048-bitMinimum; fine for older peers
15, 16MODP 3072, 4096-bitYes, but slower
19ECP 256-bitYes
20ECP 384-bitYes, a common modern default
21ECP 521-bitYes, where both peers support it
31Curve25519Yes, where both peers support it

Elliptic-curve groups (19, 20, 21, 31) give strong security with less CPU than large MODP groups, which helps when a gateway terminates many tunnels.

Set the PFS group explicitly on both peers. A tunnel that comes up fine and then drops at the first child SA rekey, often after about an hour, is almost always a PFS mismatch.

Perfect forward secrecy and lifetimes

With PFS, every child SA rekey runs a fresh Diffie-Hellman exchange, so keys from one period can't be used to decrypt another. It costs a little CPU at each rekey and is worth turning on for every new tunnel. Use the same group as the IKE proposal unless a peer needs otherwise.

Lifetimes decide how often keys change. Common values are several hours up to 24 hours for the IKE SA and about one hour for child SAs. The lifetimes don't have to match exactly in IKEv2, since each peer rekeys on its own schedule, but keeping them aligned makes logs easier to read. Very short lifetimes add load and rekey collisions without adding real security.

These three sets cover almost every peer. Offer the strongest set your peer supports, and keep a weaker set only as long as an old device needs it.

IKE proposalESP proposalWhen
StrongestAES-256, SHA-384, group 20AES-256-GCM, PFS group 20Current firewalls and routers
BroadAES-256, SHA-256, group 19 or 14AES-256-CBC, SHA-256, PFS group 19 or 14Broad compatibility, including older releases
LegacyAES-128, SHA-256, group 14AES-128-CBC, SHA-256, PFS group 14Low-power or old peers, as a temporary step

The same proposals are written differently on each platform. Here is the broad set in strongSwan syntax:

# swanctl.conf (example)
proposals = aes256-sha256-ecp256,aes256-sha256-modp2048
esp_proposals = aes256-sha256-ecp256,aes256-sha256-modp2048

The vendor guides show the equivalent lines for Cisco, FortiGate, Palo Alto, MikroTik and pfSense.

Matching proposals between vendors

  • Write down both sides. Before changing anything, list the exact IKE and ESP algorithms each peer offers, including the DH and PFS groups. Defaults differ between vendors and between releases.
  • Translate names. "Group 20", "ecp384" and "384-bit elliptic curve" are the same thing; "aes256gcm16" in strongSwan is AES-256-GCM with a 16-byte ICV.
  • Offer one proposal while testing. A single proposal per side makes mismatches obvious in the logs. Add fallbacks later if you need them.
  • Read the responder's log. It usually lists what was received and what it was configured to accept, which shows the mismatch directly. See the IPsec troubleshooting guide.
  • Change both ends together. When you retire an old algorithm, agree a window with whoever runs the other peer, or add the new proposal first and remove the old one after both sides have rekeyed.

What to retire, and how

Audit existing tunnels for DES, 3DES, MD5, SHA-1, DH groups 1, 2 and 5, and IKEv1. For each tunnel, check what the peer supports, add a modern proposal ahead of the old one on both sides, confirm after the next rekey that the new algorithms are in use, then remove the old proposal. The IKEv1 vs IKEv2 article covers moving a tunnel to IKEv2.

TunnelYard runs IKEv2 with AES-256 by default and offers Standard, Modern and Compatible presets, so you can pick the one that matches your peer; guided tunnel setup suggests proposals for the device on the other end, and the Enterprise plan adds custom IPsec proposals. See features and pricing.

Bottom line

Pick IKEv2, AES-256, SHA-256 or better, an elliptic-curve DH group or at least group 14, and PFS. Retire anything older. Then make sure both peers offer the same proposal, because a strong IPsec configuration that doesn't match on both ends is a tunnel that never comes up.

FAQ

Choosing IPsec proposals: common questions

What is the best encryption for an IPsec VPN?

AES-256 is the standard choice for new IPsec tunnels, either as AES-256-GCM, which also provides integrity, or AES-256-CBC with HMAC-SHA-256. Pair it with SHA-256 or SHA-384 for the PRF, Diffie-Hellman group 19 or 20 (or 14 for older peers) and perfect forward secrecy.

Should I use AES-GCM or AES-CBC for IPsec?

AES-GCM is faster on modern hardware and needs no separate integrity algorithm, so prefer it when both peers support it. AES-CBC with SHA-256 is supported everywhere and is the safe choice for older devices. Both are secure; what matters is that both peers offer the same one.

Which Diffie-Hellman group should I use for IPsec?

Use group 19 (ECP-256) or group 20 (ECP-384) for new tunnels, or group 14 (2048-bit MODP) as the minimum for peers that support nothing newer. Retire groups 1, 2 and 5. Set the same group explicitly on both peers, for IKE and for PFS, because vendor defaults differ.

Should perfect forward secrecy be enabled for IPsec?

Yes. PFS runs a fresh Diffie-Hellman exchange at every child SA rekey, so one compromised key does not expose traffic from other periods. Enable it on both sides with the same group. A tunnel that drops after about an hour, at the first rekey, usually has PFS on one side only or with different groups.

Which IPsec algorithms are insecure and should be retired?

Retire DES, 3DES, MD5, SHA-1 and Diffie-Hellman groups 1, 2 and 5, and move IKEv1 tunnels to IKEv2. Add a modern proposal ahead of the old one on both peers, confirm the new algorithms are used after the next rekey, then remove the old proposal. RFC 8221 and RFC 8247 list the current requirements.

What causes NO_PROPOSAL_CHOSEN in IPsec?

The peers share no identical proposal: the encryption, integrity or PRF, or the Diffie-Hellman or PFS group differ, or one side uses IKEv1. List the exact algorithms on both sides, offer a single matching proposal while testing, and read the responder's log. See IPsec troubleshooting.