IKEv1 or IKEv2: which should you use for your VPN?

IKEv2 has been the standard for new IPsec tunnels for years, and IKEv1 is now formally deprecated. Here's what actually changed between them, and the few cases where you still need the old version.

IKEv1main + quick mode · 9 msgsIKEv2IKE_SA_INIT + IKE_AUTH · 4

The short answer

Use IKEv2 for every new site-to-site tunnel. Keep IKEv1 only for a peer that can't do IKEv2, and plan to upgrade or replace that peer. The IETF deprecated IKEv1 in RFC 9395, and most vendors already treat it as legacy.

What IKEv2 changed

IKE (Internet Key Exchange) is the protocol two IPsec peers use to authenticate each other and agree on keys. IKEv1 dates from 1998 (RFC 2409). IKEv2 was first published in 2005 and is defined today by RFC 7296. These are the differences that matter in practice:

IKEv1IKEv2
Messages to bring up a tunnel9 with main mode + quick mode (6 with aggressive mode)4 (IKE_SA_INIT + IKE_AUTH)
NAT traversalAdded later as an extension (RFC 3947)Built in
Liveness checksDead peer detection as an extension (RFC 3706)Built in
Extra authenticationXAUTH and mode config, non-standardEAP and configuration payloads, built in
Changing client IPTunnel must be rebuiltMOBIKE (RFC 4555) keeps it up
ReliabilityLost messages could leave peers out of syncEvery request is acknowledged and retransmitted

Fewer round trips mean tunnels come up faster and there are fewer places for a negotiation to fail. Built-in NAT traversal and liveness checks mean less vendor-specific behaviour to debug.

IKEv1 and IKEv2 don't interoperate. Both peers must use the same version, so changing one side always means changing the other at the same time.

Where IKEv1 still shows up

  • Older firewalls and routers whose firmware predates solid IKEv2 support.
  • Networks you don't control, such as a partner or supplier that only offers IKEv1.

In each case IKEv1 is a compatibility setting, not a choice. Use the strongest proposals the peer supports and set a date to revisit it.

Moving a tunnel from IKEv1 to IKEv2

  1. Confirm the peer supports IKEv2 and note which proposals it offers.
  2. Agree on a maintenance window with whoever runs the other side.
  3. Switch the IKE version on both ends together, keeping subnets and keys unchanged.
  4. Bring the tunnel up and check both the IKE SA and the child SAs.
  5. Once traffic flows, tighten any weak proposals you inherited from the IKEv1 setup.

On a strongSwan peer, the version is one setting in the connection definition:

connections {
  branch-office {
    version = 2   # was 1
    proposals = aes256gcm16-prfsha384-ecp384
    # ...
  }
}

TunnelYard tunnels use IKEv2 only, so move the peer to IKEv2 first, then export its config from the tunnel so both sides match. The same applies when several offices share one gateway.

Bottom line

Default to IKEv2. Treat every remaining IKEv1 tunnel as technical debt with an owner and a date.

FAQ

IKEv1 vs IKEv2: common questions

What is the main difference between IKEv1 and IKEv2?

IKEv2 brings a tunnel up in 4 messages (IKE_SA_INIT and IKE_AUTH), while IKEv1 needs 9 with main mode and quick mode, or 6 with aggressive mode. IKEv2 also builds in NAT traversal, liveness checks, EAP and MOBIKE, and acknowledges and retransmits every request. In IKEv1 these were later extensions or non-standard add-ons such as XAUTH.

Is IKEv1 deprecated?

Yes. The IETF deprecated IKEv1 in RFC 9395, and most vendors already treat it as legacy. IKEv1 dates from 1998 (RFC 2409); IKEv2 was first published in 2005 and is defined today by RFC 7296. Use IKEv2 for every new site-to-site tunnel, and keep IKEv1 only for a peer that cannot do IKEv2.

Can an IKEv1 peer connect to an IKEv2 peer?

No. IKEv1 and IKEv2 do not interoperate, so both peers must be set to the same IKE version. Changing one side always means changing the other at the same time, ideally in an agreed maintenance window. A mismatch typically shows up as NO_PROPOSAL_CHOSEN or as no response at all, because the two peers never agree on a negotiation.

When do you still need IKEv1 for an IPsec VPN?

Only for compatibility: older firewalls and routers whose firmware predates solid IKEv2 support, and partners or suppliers that only offer IKEv1. Use the strongest proposals the peer supports and set a date to revisit it. TunnelYard uses IKEv2 only, so a peer like this needs an IKEv2-capable firmware or device first.

How do I migrate an IPsec tunnel from IKEv1 to IKEv2?

Confirm the peer supports IKEv2 and note its proposals, agree a maintenance window with whoever runs the other side, then switch the IKE version on both ends together while keeping subnets and keys unchanged. Bring the tunnel up, check both the IKE SA and the child SAs, and once traffic flows, tighten any weak proposals inherited from IKEv1. See IPsec troubleshooting if it fails.

How do I set IKEv2 in a strongSwan swanctl.conf connection?

In strongSwan the IKE version is one setting in the connection definition: set version = 2 (it was 1 for IKEv1) inside the connection block in swanctl.conf, for example alongside proposals = aes256gcm16-prfsha384-ecp384. Make the same change on the remote peer, then reload the configuration. A complete example is in the IPsec VPN server setup guide.