Technical Tip: How to use TCP as transport for IKE/IPsec traffic
| Description | This article describes available options for encapsulating of Encapsulating Security Payload (ESP) packets within Transmission Control Protocol (TCP) headers in FortiOS.
It allows ESP packets to be assigned a port number, enabling them to traverse carrier networks where direct IPsec traffic is blocked or impeded by carrier-grade NAT. |
| Scope | FortiGate v7.4.2 or above, IKEv2. |
| Solution | See Encapsulate ESP packets within TCP headers for comparison of the standards-based and proprietary option.
Option 1: TCP encapsulation using standards-based RFC 8229. Requires FortiOS v7.4.4 or later.
See the article Technical Tip: How to configure FortiGate to use TCP encapsulation of IKE and IPSec packets. This is the only FortiClient-compatible TCP encapsulation option and is also recommended for FortiGate-FortiGate or FortiGate-third-party tunnels.
Option 2: The 'fortinet-esp' proprietary protocol. Requires FortiOS v7.4.2 or later. Only tunnels between two FortiGates with fortinet-esp enabled are supported, and ADVPN is not supported. For a configuration example, see Encapsulate ESP packets within TCP headers.
Note that when fortinet-esp is enabled, the TCP headers containing ESP traffic reuse the same sequence number and may be dropped by carrier networks that block TCP replay traffic. If ESP packets are not arriving on the remote FortiGate, use option 1. Default IKE TCP port: By default, the FortiGate uses TCP port 4500. It is possible to change this to a different port number by going to the global settings and modifying the 'ike-tcp-port' option.
Note that changing ike-tcp-port bounces all IPsec tunnels. In production, changing the TCP port can cause interruption in IPsec traffic and require 'diagnose vpn ike restart' to bring the tunnel back.
In FortiOS v7.6.1 and above, TCP port 443 is used by default to encapsulate ESP packets within TCP headers.
Notes:
Related documents: Technical Tip: How to configure FortiGate to use TCP encapsulation of IKE and IPsec packets IPsec VPN over TCP on Windows, macOS, and Linux 7.4.1 |
