GRE and IPsec tunnels·续
Documentation sometimes refers to this as Phase 2 Diffie-Hellman Group. Do not confuse this with PRF. Cloudflare supports the following Diffie-Hellman (DH) groups. - DH group 20 (384-bit random ECP group) - DH group 14 (2048-bit MODP group) - DH group 5 (1536-bit MODP group)
Post-quantum security
If the Child SA uses DH groups for Perfect Forward Secrecy, it is still protected against quantum threats if the parent IKE SA was established using a hybrid ML-KEM exchange.
Caution
Cloudflare recommends that you use only one DH group when configuring your device, specifically DH group 20.
Note
Cloudflare recommends configuring the Child SA rekey interval (SA lifetime) between 30 minutes and 8 hours.
</details>
<details>
<summary>
Required configuration parameters
</summary>
- The IKE version must be IKEv2.
- The IKE authentication method must be Pre-Shared Key (PSK).
- Cloudflare supports NAT traversal (NAT-T). Cloudflare also supports NAT-T starting on port <code>4500</code>.
- (Uncommon) You must disable Extended Sequence Numbers (ESN).
- If your tunnels need replay protection, enable Dead Peer Detection (DPD) in your router and select the option that restarts your IKE session when a DPD timeout occurs. This "restart" option ensures that the connection can recover in the event that a Cloudflare server goes offline. If your router does not offer this setting, check the router documentation for its dead peer detection behavior.
- Multiple Key Exchange (<a href="https://datatracker.ietf.org/doc/rfc9370/">RFC 9370 ↗︎</a>): To use post-quantum security, your router must support the <code>IKE_INTERMEDIATE</code> and <code>IKE_FOLLOWUP_KE</code> exchange as defined in RFC 9370 and <a href="https://datatracker.ietf.org/doc/draft-ietf-ipsecme-ikev2-mlkem/">draft-ietf-ipsecme-ikev2-mlkem ↗︎</a>. Because post-quantum public keys and ciphertexts (like ML-KEM-768) are larger than classical keys, you must enable IKEv2 fragmentation on your router to prevent packets from exceeding the 1,500-byte MTU. When configuring the first Additional Key Exchange, use the IANA-assigned Transform ID <code>36</code> for ML-KEM-768, or Transform ID <code>37</code> for ML-KEM-1024.
</details>
<details>
<summary>
Optional configuration parameters
</summary>
- Disable <a href="https://developers.cloudflare.com/cloudflare-wan/reference/anti-replay-protection/">anti-replay protection</a>.
- <code>NULL</code> encryption for IPsec (not recommended): Do not use this option unless necessary because it reduces security by leaving IPsec traffic unencrypted. You must explicitly opt in to use this option. Using this option also eliminates post-quantum protections.
</details>
Tested third-party vendor interoperability
The following third-party vendors have been tested and validated to interoperate with Cloudflare IPsec for post-quantum key agreement:
| Vendor | Product / Version | ML-KEM variant | DH group | Notes |
|---|---|---|---|---|
| Cisco | Cisco 8000 Series Secure Routers with IOS XR Release 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 | Requires RFC 9370 and draft-ietf-ipsecme-ikev2-mlkem support. |
| Fortinet | FortiOS 7.6.6+ | ML-KEM-1024 | Group 20 | Requires RFC 9370 and draft-ietf-ipsecme-ikev2-mlkem support. |
Cloudflare continues to test and validate additional third-party devices. If you have successfully configured post-quantum IPsec with a vendor not listed here, contact your account team.
Supported IKE ID formats
Cloudflare WAN supports the following IKE ID types for IPsec:
<details>
<summary>
Request for Comments (RFC) name <code>ID_RFC822_ADDR</code>
</summary>
- Format: <code>ipsec@<TUNNEL_ID>.<ACCOUNT_ID>.ipsec.cloudflare.com</code>
- Example: <code>ipsec@f5407d8db1a542b196c59f6d04ba8bd1.123456789.ipsec.cloudflare.com</code>
</details>
<details>
<summary>
RFC name <code>ID_FQDN</code>
</summary>
- Format: <code><TUNNEL_ID>.<ACCOUNT_ID>.ipsec.cloudflare.com</code>
- Example: <code>f5407d8db1a542b196c59f6d04ba8bd1.123456789.ipsec.cloudflare.com</code>
</details>
<details>
<summary>
RFC name <code>ID_KEY_ID</code>
</summary>
- Format: <code><ACCOUNT_ID>_<TUNNEL_ID></code>
- Example: <code>123456789_f5407d8db1a542b196c59f6d04ba8bd1</code>
</details>
Additionally, Cloudflare supports the IKE ID type of ID_IPV4_ADDR if the following two conditions are met:
- You set the IPsec tunnel's
customer_endpointvalue. - The combination of
cloudflare_endpointandcustomer_endpointis unique among the customer's IPsec tunnels.
Caution
Make sure each IPsec tunnel has a unique combination of a Cloudflare endpoint and customer endpoint. If this combination is not unique among your IPsec tunnels, you should use one of the custom IKE formats (ID_RFC822_ADDR, ID_FQDN, or ID_KEY_ID) to specify the tunnel ID and account ID. This helps Cloudflare link the IKE packet to the right IPsec tunnel for tasks like authentication.
Route-based vs. policy-based VPNs
Although Cloudflare supports both route-based and policy-based VPNs, we recommend route-based VPNs.
If route-based VPNs are not an option and you must use policy-based VPNs, be aware of the following limitations:
- Cloudflare only supports a single set of traffic selectors per Child SA.
- A policy must cover reply-style health checks — that is, they must match traffic selectors — otherwise, Cloudflare drops them, just like any other traffic from an IPsec tunnel that does not match a policy.
- A single IPsec tunnel can only contain around 100 Child SAs. Therefore, there is effectively a limit on the number of different policies per tunnel.
Improved downgrade protection (beta)
Beta
This feature is in beta. Contact your account team to turn on the ipsec_downgrade_protection flag for your account.
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 create a "split view" of the handshake, tricking the endpoints into downgrading a post-quantum connection back to classical cryptography even when both sides support post-quantum key exchange.
To address this, Cloudflare supports the IKE_SA_INIT_FULL_TRANSCRIPT_AUTH ↗︎ IKEv2 extension. When enabled, both IKEv2 peers sign the entire handshake transcript during the authentication exchange, rather than only their own messages. This prevents an attacker from downgrading the connection without being detected.
How it works:
- When the feature flag is enabled, Cloudflare (acting as IKE responder) unconditionally includes an
IKE_SA_INIT_FULL_TRANSCRIPT_AUTHnotification in itsIKE_SA_INITresponse. - If the initiator also supports the extension, both sides use full transcript authentication, which improves protection again downgrade attacks.
- If the initiator does not support the extension, the handshake proceeds with standard IKEv2 authentication. Both parties must support the extension for downgrade protection to be effective.
Requirements:
- Your IKEv2 initiator must support the
IKE_SA_INIT_FULL_TRANSCRIPT_AUTHnotification as defined in draft-ietf-ipsecme-ikev2-downgrade-prevention ↗︎.
Troubleshooting
For help resolving tunnel issues:
- Troubleshoot tunnel health - Diagnose and fix health check failures
- Troubleshoot with IPsec logs - Use Logpush to analyze IPsec handshake issues
Troubleshooting
For help resolving tunnel issues:
- Troubleshoot tunnel health - Diagnose and fix health check failures
- Troubleshoot with IPsec logs - Use Logpush to analyze IPsec handshake issues
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/cloudflare-wan/reference/gre-ipsec-tunnels/#page","headline":"GRE and IPsec tunnels","description":"Cloudflare WAN uses Generic Routing Encapsulation (GRE) and IPsec tunnels to transmit packets from Cloudflare's global network to your origin network.","url":"https://developers.cloudflare.com/cloudflare-wan/reference/gre-ipsec-tunnels/","inLanguage":"en","image":"https://developers.cloudflare.com/cloudflare-wan/reference/gre-ipsec-tunnels/og.png?v=8b01fdf1dc503bb3","dateModified":"2026-08-24","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: How tunnel health alert thresholds are calculated. title: How Cloudflare calculates tunnel health alerts image: https://developers.cloudflare.com/cloudflare-wan/reference/how-cloudflare-calculates-tunnel-health-alerts/og.png?v=6244494988fd49b3
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/cloudflare-wan/llms.txt
Use this file to discover all available pages before exploring further.
Docs