What is Internet Key Exchange (IKE)?

Internet Key Exchange (IKE) is a protocol that helps two devices establish and manage a secure connection. Commonly used with IPsec to create VPN tunnels, IKE authenticates both devices, negotiates security settings, and generates encryption keys. IKE handles the setup and maintenance of the secure tunnel, while IPsec encrypts the data traveling through it.

A woman using IKE protocol.

What is Internet Key Exchange?

Internet Key Exchange (IKE) is a protocol used for the secure exchange of cryptographic keys between endpoints (for example, to create safe virtual private network (VPN) communication conduits). In addition, the IKE protocol is responsible for orchestrating the agreement of security protocols and algorithms, generating keys, and managing security associations (SAs).

How Internet Key Exchange (IKE) works

IKE begins when one device, called the initiator, contacts another device, called the responder. They negotiate compatible security settings, exchange the information needed to derive shared encryption keys, authenticate each other, and establish one or more security associations.

The exact process depends on the version used.

IKEv1

IKEv1 divides negotiation into two phases:

  • Phase 1. The devices authenticate each other and create a protected channel for further negotiation. This phase can use Main Mode or the faster but less secure Aggressive Mode.
  • Phase 2. The devices use the protected channel to negotiate the IPsec security associations and keys that will secure their data. This process is commonly called Quick Mode.

IKEv1 is now considered a legacy protocol. Its more complicated design and older authentication options make it harder to configure securely.

IKEv2

IKEv2 simplifies the process into several exchanges:

  1. 1.IKE_SA_INIT. The devices agree on cryptographic algorithms, exchange nonces, and perform a key exchange to derive shared keying material.
  2. 2.IKE_AUTH. They authenticate each other and establish the first IPsec Child SA, which protects the actual network traffic.
  3. 3.CREATE_CHILD_SA. This optional exchange creates additional Child SAs or replaces keys before they expire.

IKEv2 typically connects faster than IKEv1, recovers more reliably from interruptions, and handles switches between networks more smoothly. The two versions are not directly compatible.

Internet Key Exchange examples

Common Internet Key Exchange use cases include:

  • VPN connections. IKE is a crucial component of establishing secure VPN connections, ensuring that both ends of the communication agree on the same encryption, integrity, and authentication methods. 
  • Mobile VPN. The IKEv2/IPsec protocol helps maintain a secure VPN connection when a device switches between Wi-Fi and cellular networks.
  • Cloud connectivity. Organizations use IKE with IPsec to connect an office network to a cloud environment.
  • Secure device communication. Servers, routers, firewalls, and other network devices use IKE/IPsec to protect traffic between fixed endpoints.
  • Automatic rekeying. IKE replaces encryption keys at defined intervals without requiring the entire VPN connection to be configured again.

Advantages and disadvantages of Internet Key Exchange

Internet Key Exchange automates much of the work required to create and maintain an IPsec connection, but its security and reliability depend on the version and configuration used.

Advantages

Disadvantages

Security. IKE provides robust security by handling the negotiation of encryption algorithms and managing key exchanges.

Complexity. IKE protocol is complex, which may make it more challenging to implement and troubleshoot.

Automated key management. IKE reduces the need to update cryptographic keys manually, eliminating potential points for failure.

Performance. Due to the complexity of the protocol and the processing requirements for encryption and decryption, IKE can potentially impact network performance.

Scalability. IKE supports various encryption, authentication, and integrity algorithms, offering flexibility based on the requirements of the network and the devices.

Version incompatibility. IKEv1 and IKEv2 can’t communicate directly with each other.

Support for rekeying. Keys can be replaced periodically, limiting how long any one set remains in use.

Network restrictions. Firewalls and restrictive networks may block the UDP ports commonly used by IKE and IPsec.

Reliable mobile connections. IKEv2 recovers more effectively when a device changes networks or briefly loses connectivity.

Legacy security risks. Older IKEv1 configurations, particularly Aggressive Mode with weak pre-shared keys, may be vulnerable to attack.

Online security starts with a click.

Stay safe with the world’s leading VPN

NordVPN experts

NordVPN experts

Our NordVPN experts know the ins and outs of cybersecurity solutions and strive to make the internet safer for everyone. With a finger on the pulse of online threats, they share their expertise and practical tips on how to avoid them. Whether you're a tech newbie or a seasoned user, you'll find valuable insights in their blog posts. Cybersecurity should be accessible to everyone — and we're making that happen, one blog post at a time.