On this page

Summary: IKEv2/IPsec is two standards doing separate jobs: IKEv2 authenticates the VPN client and server and negotiates and maintains the encryption keys, while IPsec’s Encapsulating Security Payload (ESP) carries your actual traffic with the encryption and integrity protection negotiated for the connection. The combination fits best when you want a VPN that can run on your device’s built-in client and keep working as a phone moves between Wi-Fi and mobile data, provided the server supports the mobility extension that makes that possible. It fits poorly on networks that block the UDP ports it depends on, and the security of any given IKEv2/IPsec connection depends far more on its authentication method, algorithms, and implementation than on the protocol name.

VPN Advisors is an independent, affiliate-supported website that explains how VPNs work, what they protect, and how to evaluate VPN services. This article explains how IKEv2 and IPsec work together, their connection behavior, and when they suit different devices and networks. For a broader comparison of VPN protocols and their practical differences, see our VPN Protocols guide.

IKEv2 and IPsec do different jobs

IPsec is the IETF’s security architecture for protecting traffic at the IP layer. RFC 4301 describes it as a set of components: security protocols (ESP and the Authentication Header, or AH), security associations that record which protection applies to which traffic, key management, and the cryptographic algorithms themselves.

IKEv2 is the key-management component. RFC 7296, which made IKEv2 an Internet Standard in October 2014, defines it as the part of IPsec that performs mutual authentication and establishes and maintains security associations (SAs). IKEv2 does not encrypt your browsing or app traffic itself. It sets up the keys and rules that ESP then uses to protect each packet. AH, the other IPsec security protocol, protects outer IP addresses in a way that is inherently incompatible with network address translation (NAT), which is why the standard for carrying IPsec through NAT leaves it out (RFC 3948). In a consumer IKEv2/IPsec VPN, traffic protection is ESP’s job.

IKEv2 and IPsec do different jobs
Layer What it does What it decides for you
IKEv2 Authenticates both ends, negotiates algorithms, derives keys, rekeys, and checks that the other end is still reachable Who you are actually connected to, which cipher suite is used, and how the tunnel is maintained
IPsec ESP When configured for encryption and integrity, protects each tunneled packet using keys IKEv2 established Confidentiality and tamper protection when both services are selected
Authentication method Certificates, EAP (for example, a username and password), or a pre-shared key How hard the connection is to impersonate or attack offline
Implementation and configuration The operating system or app code, its default proposals, and which extensions are enabled Real-world security, mobility behavior, and compatibility

This is why the labels matter. In consumer VPN apps, “IKEv2” is typically shorthand for IKEv2 setting up ESP-protected tunnels, hence the combined name IKEv2/IPsec. “IPsec” on its own is ambiguous: device settings and router menus also use it for older IKEv1-based setups and for L2TP/IPsec, which Apple, for example, lists separately from IKEv2/IPsec. IKEv1 is not an equivalent alternative. RFC 9395 deprecated it in April 2023 and moved its specifications to Historic status. When a setting or review says only “IPsec,” check which key exchange it means.

How an IKEv2/IPsec connection is set up

In the common case, RFC 7296 brings up a working tunnel with two request-and-response exchanges, four messages in total:

  1. IKE_SA_INIT. The two sides agree on cryptographic algorithms, exchange random nonces, and perform a Diffie-Hellman exchange. From this point both can derive shared keys, and the rest of the conversation is encrypted.
  2. IKE_AUTH. Each side proves its identity, for example with a certificate-backed signature, and the two create the first “Child SA,” the ESP tunnel that will carry traffic. Because this exchange is already encrypted, the identities are hidden from passive eavesdroppers.

When the client signs in with the Extensible Authentication Protocol (EAP), such as a username and password, IKE_AUTH expands into additional round trips, but the structure is the same. For remote-access VPNs, the client also requests an internal IP address from the VPN server during IKE_AUTH.

Once the tunnel is up, IKEv2 keeps maintaining it. It rekeys SAs over time, and a fresh Diffie-Hellman exchange is mandatory whenever the main IKE SA is rekeyed. When it has not heard from the other side recently, it sends an empty encrypted message as a liveness check, commonly called dead peer detection, so a vanished server is noticed instead of silently absorbing traffic. Ephemeral Diffie-Hellman exchanges support forward secrecy: once a connection’s keys and temporary secrets have been discarded, previously recorded traffic should remain protected if a long-term authentication key is later exposed. A new Diffie-Hellman exchange is required when rekeying the IKE SA, but is optional when rekeying an ESP Child SA.

On the network, IKE normally starts on UDP port 500, but it can begin on UDP 4500. If IKEv2 detects a NAT device between the two ends, both sides move to UDP port 4500 and wrap ESP packets inside UDP so the NAT can track them. strongSwan’s documentation notes that its mobility support moves connections to port 4500 even when no NAT is present. UDP ports 500 and 4500 are the usual ports to check, but an individual connection does not always need both.

Why IKEv2/IPsec has a reputation for mobile stability

The reputation is earned, but it rests on an extension rather than on IKEv2 alone. In base IKEv2, SAs are tied to the IP addresses in use when the connection was established, and when a phone moves from Wi-Fi to mobile data, its address changes.

MOBIKE (RFC 4555) allows the addresses associated with the IKE SA and tunnel-mode IPsec SAs to change. It updates only the outer addresses of the tunnel; the addresses used inside it stay the same, so a network switch can be mostly invisible to apps using the VPN. That is the mechanism behind claims that IKEv2 “survives network changes.” Three qualifications apply:

  • Both ends must support it. Support for MOBIKE is signaled during setup, so a client that implements it gains nothing if the provider’s server does not.
  • It has limits. RFC 4555 does not support both sides moving at the same time, and it does not work over network paths that only allow one-way connectivity.
  • Platform behavior varies. strongSwan’s interoperability notes state that Windows 7 and later support IKEv2 with MOBIKE, and Android’s platform IKEv2 library, the default since Android 11, lists handoff among its supported functions. Without MOBIKE, how quickly a connection recovers from an address change depends on the client’s reconnection behavior.

Where IKEv2/IPsec is built in

IKEv2/IPsec’s other distinguishing trait is that major operating systems ship their own client for it, so a VPN can sometimes be configured without installing an app.

Where IKEv2/IPsec is built in
Platform Built-in support What to know
Windows The built-in VPN client offers IKEv2 as a connection type, with EAP-based authentication for username-and-password or certificate sign-in. Microsoft states that the default IKEv2 settings (3DES encryption, SHA-1, and Diffie-Hellman group 2) aren’t secure and must be changed with PowerShell cmdlets.
Apple devices iOS, iPadOS, macOS, tvOS, visionOS, and watchOS include a native IKEv2 client; no third-party app is required if the server supports it. Supports shared-secret, RSA or ECDSA certificate, EAP-MSCHAPv2, and EAP-TLS authentication. Version 26 releases can add ML-KEM key exchanges for quantum resistance when the VPN server also supports them.
Android Since Android 11, an updatable platform IKEv2 library is the default IKEv2 client, replacing the IKEv1-based built-in client used through Android 10. Apps can hand an IKEv2 profile to the platform so the VPN runs without the app staying active in the background.
Linux Support comes from software such as strongSwan, whose NetworkManager plugin adds IKEv2 connections to the desktop network settings. The plugin supports IKEv2 only, authenticates the server with a certificate, and supports EAP or public-key authentication for the client.

Two cautions apply to this table.

Native support doesn’t mean native code is in use. A provider’s app may hand a profile to the operating system’s own IKEv2 client, as Android’s profile mechanism allows, or it may ship its own VPN implementation, which Apple’s Network Extension framework permits. Two apps that both say “IKEv2” can therefore run different code with different defaults and different mobility behavior.

Native support doesn’t mean secure defaults. Windows is the clearest example: the built-in client works out of the box, but its defaults rely on algorithms Microsoft itself describes as insecure. A manually created connection may keep those default proposals unless its policy is changed, but the server also determines which algorithms can actually be negotiated.

What determines the security of an IKEv2/IPsec connection

IKEv2/IPsec is a negotiation framework, not a fixed cipher. The client proposes cipher suites, the server picks one, and the result can be strong or weak. Three factors matter most.

The algorithms negotiated

IKEv2 supports current algorithms, and the IETF maintains implementation requirements for them in RFC 8247, which RFC 9395 updated to deprecate older options. Weak choices remain possible whenever both sides accept them. The NSA’s guidance on configuring IPsec VPNs names DES, 3DES, and Diffie-Hellman groups 1, 2, and 5 as outdated algorithms that organizations should be able to detect or block.

Diffie-Hellman group size matters because of the 2015 “Imperfect Forward Secrecy” research, which estimated that breaking widely used 1024-bit groups was plausible with nation-state resources and that precomputation for a small number of such groups would allow passive decryption of a large share of the IKE VPNs measured at the time. The remedy is configuration, not abandoning the protocol: stronger groups such as 2048-bit or elliptic-curve Diffie-Hellman.

How each side authenticates

  • Certificates. The server proves its identity with a certificate-backed signature. RFC 7296 requires that when a client authenticates with EAP, the server must still authenticate with a public-key signature. Certificate-verified server identity is the baseline to look for.
  • EAP. Lets the client authenticate with account credentials (for example, EAP-MSCHAPv2) or a client certificate (EAP-TLS). RFC 7296 advises against EAP methods that don’t generate a shared key, because using them in other protocols without a server-authenticated tunnel can expose users to man-in-the-middle attacks.
  • Pre-shared key (PSK). A single shared secret. RFC 7296 warns that a PSK derived from a user-chosen password is typically insecure because it cannot resist dictionary attacks, and 2018 research presented at USENIX Security demonstrated offline dictionary attacks against low-entropy PSKs in IKEv2. When the same PSK authenticates both ends, distributing it to many users also gives each holder a way to try to impersonate the server.

Implementation quality

Several published IKE weaknesses have been implementation flaws rather than flaws in the standard. The same 2018 study found Bleichenbacher oracles in the IKEv1 implementations of four network-equipment vendors; because an RSA key reused across protocol versions could be attacked through them, the flaw also broke RSA-signature authentication in IKEv2. The vendors issued fixes, and the researchers stressed that the problem was an implementation error, not a bug in the standard. As with the Windows defaults, who wrote and configured the IKEv2/IPsec code matters.

IKEv2 also has a standard path to post-quantum key exchange. RFC 9370 allows up to seven additional key exchanges in a connection, and the IETF’s IPsec working group has drafted a profile for using ML-KEM that way. Apple’s platform security documentation already lists configurable ML-KEM key exchanges for its version 26 operating systems.

The protocol label says nothing about a provider’s logging, server security, or how its app handles DNS and dropped connections. Those are questions about the service, not about IKEv2/IPsec.

The main practical limitation: networks that block UDP

IKEv2/IPsec normally operates over UDP ports 500 and 4500, so a network that filters those ports can block its usual transport. This is a documented problem: the IETF’s TCP encapsulation standard (RFC 8229) was written because many middleboxes on public hotspots block all UDP traffic, including IKE and IPsec, while allowing TCP through.

RFC 9329, which replaced RFC 8229, defines a fallback that carries IKE and ESP over TCP. It is a fallback for a reason: the standard says implementations should prefer direct or UDP-encapsulated ESP because of the performance costs of TCP. Whether a particular client and server support the fallback at all is an implementation detail, so don’t assume it. On a network that only permits web traffic, a standard IKEv2/IPsec connection may simply fail to connect.

What can and can’t be said about speed

Throughput depends on the negotiated algorithms, device hardware, implementation, and server, so there is no basis for a universal speed ranking. A few structural points are well supported:

  • Connection setup is compact: four messages in the common case, more when EAP is used.
  • RFC 7296 describes UDP encapsulation for NAT traversal as slightly less efficient than plain ESP, and TCP fallback adds further overhead.
  • In implementations such as strongSwan on Linux, ESP packets are processed in the operating system kernel while IKE negotiation runs in a separate user-space daemon.
  • Larger ML-KEM public keys and ciphertexts can require extra packets during setup. The current IETF draft expects little effect on long-running tunnel throughput, rather than a speed penalty on every data packet.

Treat a provider’s claim that IKEv2 is “the fastest” as a claim about that provider’s deployment, not a property of the protocol.

When IKEv2/IPsec is a good fit

IKEv2/IPsec tends to be a sound choice when:

  • You want a VPN that runs on your operating system’s own client, or your provider offers a native IKEv2 profile for Apple devices, Windows, or Android 11 and later.
  • Your device changes networks often, such as a phone moving between Wi-Fi and mobile data, and the provider’s servers support MOBIKE.
  • You value a long-standardized protocol with independent implementations across major platforms.

It is a weaker fit when:

  • You regularly use networks that block UDP or allow only web traffic, and your client has no TCP fallback.
  • The setup relies on a short or widely shared pre-shared key instead of certificate-based server authentication.
  • You would be relying on a Windows built-in IKEv2 connection without confirming that it negotiates modern cryptographic settings.
  • You need it on Linux and don’t want to install and configure additional software.

Questions to check before relying on it

  1. How does the server authenticate: with a certificate, or with a shared PSK?
  2. How do you authenticate: EAP with account credentials, a client certificate, or the PSK?
  3. Which algorithms are proposed? Avoid 3DES, SHA-1, and Diffie-Hellman groups of 1024 bits or smaller. Microsoft’s own hardened example uses AES-128, SHA-256, and Diffie-Hellman group 14.
  4. If you’ll switch networks, does the provider’s server support MOBIKE?
  5. Does the app use the operating system’s IKEv2 client or its own implementation?
  6. What happens on a network that blocks UDP ports 500 and 4500?