IPsec Tunnel IKEv2: Post-Quantum ML-KEM, NAT-T Traversal, and Downgrade Protection
How Cloudflare WAN and Magic Transit IPsec tunnels use IKEv2, hybrid ML-KEM, NAT-T on UDP 500, and transcript authentication.
This page summarises Cloudflare documentation on IPsec tunnels for Cloudflare WAN and Magic Transit: encrypted site-to-site links over the public Internet using IKEv2, with optional post-quantum key agreement, NAT traversal (NAT-T), downgrade protection, and custom IKE identities for high-availability designs.
IPsec tunnels provide encrypted, stateful network connectivity between your infrastructure and Cloudflare. IPsec tunnels are used with Cloudflare WAN and Magic Transit for secure site-to-site connectivity, using IKEv2 for tunnel negotiation and AES-GCM or AES-CBC for encryption.
— Cloudflare, Connectivity options
IPsec and GRE tunnels require a Cloudflare WAN subscription. Cloudflare acts only as the IKE responder; your router or firewall is the initiator. For parameter details and supported transforms, see GRE and IPsec tunnels.
IPsec tunnels: when to use IKEv2 site-to-site links
Section titled “IPsec tunnels: when to use IKEv2 site-to-site links”IPsec tunnels fit when you must encrypt traffic on the public Internet or meet compliance for encrypted connections. They work with generic routers and firewalls and with cloud gateways (AWS, Azure, GCP). Negotiation is IKEv2; the data plane is the Child SA (ESP), where user traffic flows.
The IKE SA is the control plane: it sets up and manages Child SAs. Each has its own cryptographic transforms. If you only need a tunnel definition and limits, start with GRE and IPsec tunnels; the sections below explain recent handshake and security capabilities.
IKEv2 handshake: how Cloudflare WAN establishes an IPsec tunnel
Section titled “IKEv2 handshake: how Cloudflare WAN establishes an IPsec tunnel”Cloudflare WAN and Magic Transit follow the same IKEv2 phases described in GRE and IPsec tunnels.
IKE_SA_INIT: initial key material and capability signals
Section titled “IKE_SA_INIT: initial key material and capability signals”Peers negotiate the IKE Security Association and derive keying material. When post-quantum exchange is supported, peers signal RFC 9370 during this phase. If account downgrade protection is enabled, Cloudflare (as responder) also sends IKE_SA_INIT_FULL_TRANSCRIPT_AUTH in IKE_SA_INIT.
IKE_INTERMEDIATE: hybrid ML-KEM post-quantum key agreement
Section titled “IKE_INTERMEDIATE: hybrid ML-KEM post-quantum key agreement”When both sides support RFC 9370, they run an extra exchange using ML-KEM (draft-ietf-ipsecme-ikev2-mlkem). The shared secret combines classical Diffie-Hellman (from IKE_SA_INIT, typically Group 20) with ML-KEM-768 or ML-KEM-1024 to mitigate harvest-now, decrypt-later attacks.
IKE_AUTH and Child SA: mutual authentication and the data plane
Section titled “IKE_AUTH and Child SA: mutual authentication and the data plane”Peers authenticate using keys from IKE_SA_INIT and, when used, IKE_INTERMEDIATE, then establish the IKE SA and negotiate the IPsec tunnel (Child SA).
Rekeying: refreshing IKE and Child security associations
Section titled “Rekeying: refreshing IKE and Child security associations”IKE and Child SAs rekey on a schedule or manually. With hybrid RFC 9370 exchanges, IKE SA rekey repeats parallel classical (DH) and post-quantum (ML-KEM) steps so quantum resistance continues across the session.
Post-quantum IPsec: ML-KEM with third-party routers and appliances
Section titled “Post-quantum IPsec: ML-KEM with third-party routers and appliances”Post-quantum key agreement for IPsec with validated third-party gear is generally available, as is post-quantum IPsec via the Cloudflare One Appliance.
Cloudflare IPsec now supports post-quantum key agreement with compatible third-party devices. Cisco and Fortinet are the first third-party vendors validated to interoperate with Cloudflare IPsec using ML-KEM (Module-Lattice-Based Key-Encapsulation Mechanism).
— Cloudflare, Post-quantum IPsec interoperability with third-party devices
Negotiation uses RFC 9370 and draft-ietf-ipsecme-ikev2-mlkem during IKE_INTERMEDIATE, combining DH Group 20 with ML-KEM-768 or ML-KEM-1024. Cloudflare reports no additional licensing for this on their side.
Validated third-party platforms for post-quantum IPsec
Section titled “Validated third-party platforms for post-quantum IPsec”| Vendor | Product / version | ML-KEM variant | DH group | Notes |
|---|---|---|---|---|
| Cisco | Cisco 8000 Series Secure Routers, IOS XR 26.1.1 | ML-KEM-1024 | Group 20 | Requires RFC 9370 and draft-ietf-ipsecme-ikev2-mlkem support |
| Fortinet | FortiOS 7.6.6+ | ML-KEM-768 | Group 20 | Same RFC/draft requirements |
| Fortinet | FortiOS 7.6.6+ | ML-KEM-1024 | Group 20 | Same RFC/draft requirements |
Source: GRE and IPsec tunnels — Tested third-party vendor interoperability. Cloudflare continues validation on other vendors; for platforms not listed, contact your account team.
For Cisco IOS XE deployment (VTIs, quantum-safe IKEv2 profiles, diagnostics), see the Cisco IOS XE third-party integration guide. The changelog entry for Cisco IOS XE notes added topics: Post Quantum Cryptography (PQC), Policy-Based Routing (PBR), and IP Service Level Agreement (IP SLA).
IPsec downgrade protection: IKE_SA_INIT_FULL_TRANSCRIPT_AUTH (beta)
Section titled “IPsec downgrade protection: IKE_SA_INIT_FULL_TRANSCRIPT_AUTH (beta)”Downgrade protection addresses a weakness in classic IKEv2 authentication: each endpoint historically signed only its own outbound messages, not the full handshake transcript.
IKEv2’s original authentication design has each endpoint sign only its own outbound messages, not the full handshake transcript. A quantum-capable on-path attacker can exploit this to bypass post-quantum key exchange by downgrading the connection to classical cryptography.
— Cloudflare, IPsec downgrade protection (beta)
Cloudflare supports the IKE_SA_INIT_FULL_TRANSCRIPT_AUTH IKEv2 extension so both peers sign the entire handshake transcript during authentication, which blocks undetected negotiation manipulation.
How downgrade protection behaves on Cloudflare as IKE responder
Section titled “How downgrade protection behaves on Cloudflare as IKE responder”When the account feature flag is enabled, Cloudflare sends the IKE_SA_INIT_FULL_TRANSCRIPT_AUTH notification unconditionally in IKE_SA_INIT responses. Both initiator (your device) and responder (Cloudflare) must support the extension for protection to apply; otherwise the handshake uses standard IKEv2 authentication. The flag is per-account (ipsec_downgrade_protection); contact your account team to enable it. Availability: beta for Cloudflare WAN and Magic Transit IPsec tunnels. Details: Improved downgrade protection (beta) in GRE and IPsec tunnels. Your initiator must support the notification in draft-ietf-ipsecme-ikev2-downgrade-prevention.
NAT-T on UDP port 500: IKE behind network address translation
Section titled “NAT-T on UDP port 500: IKE behind network address translation”Many sites place the IKE initiator behind NAT. Cloudflare now supports the standard NAT-T flow: IKE starts on UDP port 500 and moves to UDP port 4500 after NAT is detected.
Cloudflare IPsec now supports the standard NAT traversal (NAT-T) flow, where IKE begins on UDP port 500 and switches to UDP port 4500 after NAT is detected.
— Cloudflare, NAT-T support for IKE on UDP port 500
Previously, devices behind NAT often had to initiate IKE directly on UDP 4500; starting on 500 could fail on paths with NAT (for example VeloCloud edges, Cisco IOS-XE, Juniper SRX). No configuration change is required on Cloudflare; the change applies to all IPsec tunnels on Cloudflare WAN and Magic Transit.
| Scenario | Expected behavior after the change |
|---|---|
| No NAT on path; IKE on UDP 500 | Unchanged |
| Tunnel already configured to start on UDP 4500 | Unchanged |
| NAT detected; IKE began on UDP 500 | Handshake can complete after switch to UDP 4500 |
| Initiator choice | May start IKE on either UDP 500 or 4500 |
NAT detection logic is unchanged. The Fortinet integration guide states that forcing IKE to port 4500 is no longer required on the Cloudflare side; legacy ike-port 4500 / nattraversal settings may remain on the FortiGate but are optional for the new Cloudflare behavior.
Custom IKE ID: FQDN identity for Magic WAN high availability
Section titled “Custom IKE ID: FQDN identity for Magic WAN high availability”Cloudflare WAN (formerly Magic WAN) customers can set a custom IKE ID on IPsec tunnels—especially with VeloCloud SD-WAN for high availability: one IKE parameter set (including IKE ID) with multiple remote IPs, sharing the same custom ID on primary and backup tunnels.
FQDN is the only supported type for custom IKE IDs.
— Cloudflare, Custom IKE ID for IPsec
This feature is API only; the dashboard has no custom IKE ID controls. Example from Custom IKE ID for IPsec:
curl "https://api.cloudflare.com/client/v4/accounts/ACCOUNT_ID/ipsec_tunnels/TUNNEL_ID" \ --request PATCH \ --json '{ "custom_remote_identities": { "fqdn_id": "<your_custom_label>.<account_id>.custom.ipsec.cloudflare.com" } }'Magic Transit documents default IKE ID formats (ID_RFC822_ADDR, ID_FQDN, ID_KEY_ID, and conditional ID_IPV4_ADDR) in GRE and IPsec tunnels (Magic Transit). Each tunnel needs a unique Cloudflare endpoint + customer endpoint pair, or you should use an explicit IKE ID format so Cloudflare maps IKE packets to the correct tunnel.
Cloudflare One Appliance: post-quantum IPsec without IKEv2 keying
Section titled “Cloudflare One Appliance: post-quantum IPsec without IKEv2 keying”The Cloudflare One Appliance terminates IPsec to Cloudflare using ESP-in-UDP with GCM-AES-256. Unlike router-initiated IKEv2, the appliance uses a non-IKE keying protocol on the control plane over TLS to derive ESP keys (Appliance reference).
From Appliance version 2026.2.0, that control plane uses TLS 1.3 with hybrid ML-KEM; the symmetric secret from TLS is injected into the ESP layer:
The appliance now uses TLS 1.3 with hybrid ML-KEM for its connection to the Cloudflare edge. During the TLS handshake, the appliance and the edge share a symmetric secret over the TLS connection and inject it into the ESP layer of IPsec.
— Cloudflare, Post-quantum encryption support for Cloudflare One Appliance
The upgrade rolls out automatically during configured interrupt windows. Broader Zero Trust context for IPsec on-ramps and off-ramps is in Post-quantum cryptography in Cloudflare One. Product-level status tables are in PQC in Cloudflare products.
Common mistakes with Cloudflare IPsec tunnels
Section titled “Common mistakes with Cloudflare IPsec tunnels”- Assuming post-quantum without RFC 9370 on both sides —
IKE_INTERMEDIATEand ML-KEM run only when initiator and Cloudflare both support RFC 9370 and ML-KEM per GRE and IPsec tunnels. - Enabling downgrade protection on Cloudflare only — Protection requires initiator support for
IKE_SA_INIT_FULL_TRANSCRIPT_AUTH; Cloudflare alone cannot enforce full transcript auth. - Duplicate endpoint pairs with
ID_IPV4_ADDR— Non-unique cloudflare_endpoint + customer_endpoint pairs break tunnel identification; use RFC822, FQDN, or KEY_ID formats (Magic Transit IKE ID formats). - Forcing IKE UDP 4500 “for Cloudflare” after NAT-T update — Unnecessary for new Cloudflare behavior; still ensure firewalls allow UDP 500 and UDP 4500 when NAT-T is in play.
- Expecting custom IKE ID in the dashboard — Use the IPsec tunnels API only.
- Treating Appliance and router IKEv2 the same — Appliances key ESP via TLS control plane, not your IKEv2 initiator config (Appliance reference).
How to check this on your site
Section titled “How to check this on your site”-
Confirm your account has Cloudflare WAN (required for IPsec and GRE) per Connectivity options, and review tunnel parameters in GRE and IPsec tunnels.
-
On the initiator, verify the IKE session reaches IKE_AUTH and Child SA up; for post-quantum, confirm your platform matches the tested interoperability table (Cisco 8000 / IOS XR 26.1.1 or FortiOS 7.6.6+ with ML-KEM and Group 20).
-
If traffic paths include NAT, test IKE starting on UDP 500 and confirm transition to UDP 4500 per NAT-T support for IKE on UDP port 500.
-
For downgrade protection (beta), confirm your account team enabled
ipsec_downgrade_protectionand that your initiator implementsIKE_SA_INIT_FULL_TRANSCRIPT_AUTH(IPsec downgrade protection (beta)). -
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about so it can be corrected or explained.