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.
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.
| Group | Type | Use it? |
|---|---|---|
| 1, 2, 5 | MODP 768, 1024, 1536-bit | No, retire |
| 14 | MODP 2048-bit | Minimum; fine for older peers |
| 15, 16 | MODP 3072, 4096-bit | Yes, but slower |
| 19 | ECP 256-bit | Yes |
| 20 | ECP 384-bit | Yes, a common modern default |
| 21 | ECP 521-bit | Yes, where both peers support it |
| 31 | Curve25519 | Yes, 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.
Recommended IPsec proposals
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 proposal | ESP proposal | When | |
|---|---|---|---|
| Strongest | AES-256, SHA-384, group 20 | AES-256-GCM, PFS group 20 | Current firewalls and routers |
| Broad | AES-256, SHA-256, group 19 or 14 | AES-256-CBC, SHA-256, PFS group 19 or 14 | Broad compatibility, including older releases |
| Legacy | AES-128, SHA-256, group 14 | AES-128-CBC, SHA-256, PFS group 14 | Low-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.