手机VPN评测台
VPN

IPsec MTU: How to Choose the Right Size and Fix Fragmentation

林书禾··6 min
IPsec MTU: How to Choose the Right Size and Fix Fragmentation

Learn what IPsec MTU means, how tunnel overhead affects packet size, and how to calculate and troubleshoot a suitable setting.

IPsec MTU is the largest inner packet that can pass through an IPsec tunnel without exceeding the underlying network’s maximum transmission unit (MTU). Because IPsec adds headers and, depending on the configuration, encryption-related data, the tunnel’s usable MTU is smaller than the physical or WAN MTU. A practical starting point is to subtract the IPsec overhead from the path MTU, then test and adjust for the actual tunnel configuration.

What IPsec MTU means

The MTU is the maximum size of an IP packet that a network link can carry in one piece. Ethernet commonly supports an MTU of 1500 bytes, though the real path MTU may be lower because of service-provider encapsulation, VPN transport, or other network layers.

IPsec wraps or transforms traffic before sending it across the network. The outer packet must carry the original packet along with IPsec information. If the resulting packet is larger than the path MTU, it may be fragmented, dropped, or handled inefficiently.

For example, an inner packet of 1500 bytes cannot generally fit inside a 1500-byte outer packet once IPsec overhead is added. The tunnel MTU must leave room for that overhead.

The exact overhead is not a fixed number. It varies with factors such as: Big IP f5 VPN download: How to Find and Install the Right Client

  • Tunnel mode versus transport mode
  • IPv4 versus IPv6 outer headers
  • ESP or AH use
  • Encryption and authentication algorithms
  • NAT Traversal (NAT-T)
  • Padding and block alignment
  • Additional encapsulation, such as VLANs or provider tunnels
IPsec MTU: How to Choose the Right Size and Fix Fragmentation: Checklist

How to calculate a starting MTU

Use this basic formula:

Tunnel MTU = path MTU − IPsec overhead

The path MTU is the smallest MTU across the route carrying the outer IPsec packets. IPsec overhead includes the outer IP header, ESP fields, any initialization vector or nonce, integrity data, padding, and, when NAT-T is used, a UDP header.

A common Ethernet path starts at 1500 bytes, but that does not mean every IPsec tunnel should use the same MTU. As a rough illustration, IPsec over IPv4 with ESP and NAT-T may add several dozen bytes, leaving an inner MTU in the mid-1400s. Other combinations can require a different value. Microsoft Edge Browser Extensions VPN: How to Choose and Use One

Use the estimate only as a starting point. Check your vendor’s documentation or calculate overhead for the precise configuration, then validate it with packet-size tests. Avoid assuming that a single generic “IPsec overhead” value fits every tunnel.

Setting or condition Effect on usable tunnel MTU
Lower path MTU Reduces the tunnel MTU directly
IPv6 outer header Usually adds more header bytes than IPv4
NAT-T Adds a UDP header to the encapsulated packet
ESP encryption and authentication Adds security fields and may require padding
Extra provider encapsulation Uses part of the available path MTU
Smaller configured MTU Reduces fragmentation risk but can increase packet overhead

Why MTU problems happen in IPsec

An MTU mismatch can produce symptoms that are easy to mistake for application or routing problems. Small requests may work while larger transfers stall. A website may load its initial page but fail when downloading larger content, or a file transfer may stop partway through.

The most common causes include:

  • The tunnel interface is configured for an MTU larger than the path can carry.
  • A device on the path blocks fragmented packets.
  • Path MTU Discovery cannot work because required ICMP messages are filtered.
  • TCP advertises a maximum segment size (MSS) that is too large for the tunnel.
  • The network path changes and its MTU becomes smaller.
  • Additional encapsulation has been added without updating the tunnel setting.

IPsec itself does not guarantee that oversized packets will be delivered successfully. Depending on the IP version, device behavior, and configuration, packets may be fragmented before encryption, fragmented afterward, or discarded. Fragmenting encrypted traffic can also make troubleshooting harder because intermediate devices may not be able to inspect the original transport-layer information. Cisco VPN AnyConnect: What It Is and How to Connect

How to troubleshoot IPsec MTU

Start by confirming the MTU on the physical interface, tunnel interface, and any intermediate WAN or provider links. Then identify the tunnel mode, outer IP version, NAT-T status, and encryption and authentication settings. These details determine how much overhead to allow.

Next, test the path with progressively larger packets and the appropriate “do not fragment” option where supported. For IPv4, the ping payload must account for the IP and ICMP headers. It is not the same as the complete IP packet size. A successful test provides evidence about the largest packet that can cross the path without fragmentation, while a failed test may also indicate that ICMP is blocked.

Check device counters and logs for fragmentation, dropped packets, or MTU-related errors. If Path MTU Discovery is expected to work, ensure that the relevant ICMP messages are permitted through firewalls. In particular, blocking “fragmentation needed” messages for IPv4 or “Packet Too Big” messages for IPv6 can prevent endpoints from learning that packets must be smaller.

When adjusting MTU, change one setting at a time and test the applications that were failing. A small reduction can be a useful diagnostic step, but an unnecessarily low MTU wastes bandwidth and increases packet-processing overhead. VPN for Microsoft Edge Free: What to Know and Which Option to Choose

IPsec MTU: How to Choose the Right Size and Fix Fragmentation: Key points

MTU reduction versus TCP MSS clamping

Reducing the tunnel MTU affects all IP traffic that uses the interface. TCP MSS clamping is narrower: it adjusts the maximum TCP segment size advertised during connection setup so TCP endpoints send smaller segments. It is often useful when you cannot configure the MTU on every client.

Approach Best suited to Limitation
Set tunnel MTU A managed tunnel where the interface can be configured consistently Does not fix every issue caused by blocked Path MTU Discovery
Clamp TCP MSS TCP traffic crossing the tunnel, especially with unmanaged endpoints Does not apply to UDP or other non-TCP traffic
Allow Path MTU Discovery Networks where endpoints can receive the required ICMP messages Fails when those messages are filtered or mishandled

MSS clamping should be based on the effective tunnel MTU, not chosen arbitrarily. It can resolve common web and file-transfer failures, but it is not a replacement for correct MTU handling for UDP, voice, gaming, or other traffic.

Determine the actual path MTU, calculate the overhead for the configured IPsec tunnel, and set a tunnel MTU that leaves sufficient room for encapsulation. Preserve Path MTU Discovery by allowing necessary ICMP messages, and use TCP MSS clamping when endpoints cannot reliably adapt or be configured.

Finally, test with realistic traffic in both directions. The recommended value is the largest inner MTU that works reliably across the full path, not simply the default Ethernet MTU or a generic number copied from another VPN setup. Clash Free: What It Means and How to Avoid Conflicts

© 2026 影川数码评测 · Yingchuan Digital Review Ltd.