IPsec MTU: How to Calculate and Troubleshoot the Right Size

Learn how IPsec affects MTU, how to choose a safe value, and how to diagnose fragmentation and connectivity problems.


IPsec MTU is the maximum packet size a network interface can send through an IPsec tunnel without fragmentation. Because IPsec adds headers and authentication data, the tunnel MTU is usually lower than the physical interface MTU. For a standard 1500-byte Ethernet path, a tunnel MTU around 1400 bytes is a common starting point, but the right value depends on the encapsulation and network path.
Editor's pick: NordVPN — fast, secure VPN — Strong encryption, a no-logs policy and apps for every device. 30-day money-back guarantee. Get NordVPN →
Compare common IPsec encapsulation overheads
| Tunnel or transport | Outer IP header | IPsec overhead to account for | Inner packet | MTU implication |
|---|---|---|---|---|
| IPv4 transport mode | IPv4 header | ESP, authentication, and optional padding | Original IP packet | Subtract overhead from path MTU |
| IPv6 transport mode | IPv6 header | ESP, authentication, and optional padding | Original IP packet | Subtract overhead from path MTU |
| IPv4 tunnel mode | IPv4 header | ESP, authentication, padding, and new outer header | Encapsulated IP packet | Less room for the inner packet |
| IPv6 tunnel mode | IPv6 header | ESP, authentication, padding, and new outer header | Encapsulated IP packet | Less room for the inner packet |
| ESP with AES-GCM | Outer IP header | ESP header, IV, tag, and padding | Protected packet | Include cipher-specific overhead |
| ESP with CBC encryption | Outer IP header | ESP header, IV, authentication data, and padding | Protected packet | Include cipher-specific overhead |
| NAT traversal | Outer IP header | IPsec overhead plus UDP encapsulation | Protected packet | UDP adds more overhead |
| Path with variable headers | IPv4 or IPv6 header | Tunnels, options, or other encapsulation | Inner packet | Measure the actual path |
Compiled November 2026; check the provider's site for current details.
What MTU means for IPsec
MTU, or Maximum Transmission Unit, is the largest IP packet a link can carry in one piece. Ethernet commonly supports an MTU of 1500 bytes. When IPsec encrypts traffic in tunnel mode, it wraps the original packet in additional headers and may add padding and integrity data.
The resulting outer packet is larger than the original. If it exceeds the MTU of any link along the path, it may be fragmented or dropped. Fragmentation can reduce performance, and some firewalls or network devices discard fragments. The result may be slow connections, failed file transfers, or websites that load only partially.
A tunnel MTU must therefore account for the entire packet on the wire, not just the original data being carried.
How to calculate IPsec MTU
A practical estimate is: Big IP F5 VPN Download: Get the Official Client Safely
Tunnel MTU = Path MTU − IPsec overhead
The overhead varies by configuration. Factors include:
- Outer IP header: typically 20 bytes for IPv4 or 40 bytes for IPv6, without optional extensions.
- ESP header and trailer.
- Integrity check value or authentication tag.
- Padding, which depends on the cipher and packet length.
- UDP encapsulation, commonly used for NAT traversal, adding 8 bytes.
- Additional tunnel or provider headers, such as GRE, VLAN, or MPLS-related encapsulation.
For example, if the path MTU is 1500 bytes and the total IPsec overhead is approximately 60 bytes, an estimated tunnel MTU is 1440 bytes. If the overhead is larger, the safe MTU will be lower. This is why a single number cannot be guaranteed for every IPsec tunnel.
| Situation | Practical starting point | Notes |
|---|---|---|
| IPsec over a 1500-byte IPv4 path | About 1400 bytes | Common conservative starting value |
| IPsec with NAT traversal | Lower than without UDP encapsulation | UDP adds additional overhead |
| IPv6 underlay | Often lower than an equivalent IPv4 setup | The outer IPv6 header is larger |
| Path with extra provider or tunnel headers | Lower still | Account for every encapsulation layer |
Treat these values as starting points, not universal settings. Check the implementation’s documentation and verify the path MTU end to end. Microsoft Edge Browser Extensions VPN: What to Know Before You Choose
Choose a method to find a working IPsec MTU
| Method | What to do | What it reveals | Limitation | Best use |
|---|---|---|---|---|
| Calculate from path MTU | Subtract outer and IPsec overhead | Estimated tunnel MTU | Depends on exact configuration | Initial sizing |
| Check interface settings | Inspect tunnel and physical interfaces | Configured MTU values | May not reveal the path limit | Configuration review |
| Ping with “do not fragment” | Test progressively larger packets | Largest packet that passes | ICMP may be filtered | Reachable-path testing |
| Use packet capture | Compare packet sizes and fragmentation | Actual encapsulated traffic | Requires access to capture points | Detailed diagnosis |
| Test TCP MSS | Transfer data with different MSS values | Whether TCP fits the tunnel | Does not test all protocols | TCP-specific issues |
| Check both directions | Test traffic from each endpoint | Direction-specific limits | Requires access to both sides | Asymmetric paths |
| Repeat after route changes | Re-test the path after changes | Whether the limit has shifted | Results can vary over time | Dynamic networks |
Compiled November 2026; check the provider's site for current details.
How to find a working MTU
The most reliable approach is to test packet sizes across the tunnel and reduce the MTU until packets pass without fragmentation.
On Linux, a common test uses ping with “do not fragment” behavior. For IPv4, try a payload size and adjust it upward or downward. Remember that the ping payload is smaller than the full IP packet because IP and ICMP headers also count. Cisco VPN AnyConnect: What It Is and How to Connect
For example:
ping -M do -s 1372 <destination>
The total IPv4 packet size for this test is typically the payload plus 28 bytes. If it fails, try a smaller payload. If it succeeds, test larger values until you find the limit. Command options differ across operating systems, and IPv6 handles packet-too-big signaling differently.
Test in both directions where possible. The forward and return paths may have different MTUs, and a packet that succeeds in one direction does not prove that the reverse path can carry the same size.
Symptoms of an MTU or MSS problem
MTU problems often appear inconsistently because small packets fit while larger ones do not. Common signs include: VPN for Microsoft Edge Free: Safe Options and How to Choose
- A VPN connects, but some websites or applications stall.
- Small pings work, but large pings or transfers fail.
- File transfers stop or become unusually slow.
- Connections work on one network but not another.
- The tunnel reports fragmentation, drops, or packet-too-big events.
TCP MSS, or Maximum Segment Size, limits the amount of application data in a TCP segment. MSS clamping adjusts the advertised TCP MSS so that TCP packets fit within the tunnel MTU. It is often an effective workaround for TCP traffic, but it does not solve MTU issues for UDP or other protocols.
Match symptoms to likely IPsec MTU fixes
| Symptom | Likely cause | First check | Possible fix | Verify with |
|---|---|---|---|---|
| Small pings work, large ones fail | Packet exceeds path MTU | Test with DF set | Lower tunnel MTU | Large-packet ping |
| TCP connection starts but stalls | MSS is too large | Inspect SYN MSS values | Clamp TCP MSS | Sustained transfer |
| Some websites load partially | Large packets are dropped | Compare affected paths | Lower MTU or enable PMTUD | Repeat page request |
| VPN works in one direction only | Asymmetric path MTU | Test each direction | Adjust the affected path | Bidirectional tests |
| Fragmentation appears unexpectedly | Tunnel MTU is too high | Capture outer packets | Reduce tunnel MTU | Packet capture |
| PMTUD does not converge | ICMP errors are blocked | Check ICMP filtering | Permit required ICMP messages | DF ping tests |
| Only tunneled traffic fails | Encapsulation overhead was missed | Review IPsec mode and transforms | Recalculate tunnel MTU | Tunnel traffic tests |
| Fix works for TCP but not UDP | MSS adjustment applies only to TCP | Test UDP packet sizes | Reduce MTU or address UDP sizing | UDP test traffic |
Compiled November 2026; check the provider's site for current details.
Common ways to fix IPsec MTU issues
Start by confirming the MTU on the physical interface and checking whether the tunnel uses ESP directly or UDP-encapsulated ESP. Include any other overlays or provider encapsulation in the calculation. Clash Free: What It Means and How to Avoid Conflicts
Then choose the appropriate fix:
- Lower the tunnel MTU: Set it to a value that keeps encapsulated packets within the path limit.
- Enable TCP MSS clamping: Set the MSS based on the effective tunnel MTU and the inner IP version. This helps prevent oversized TCP segments.
- Allow Path MTU Discovery: Ensure devices and firewalls do not block relevant ICMP messages, such as IPv4 “fragmentation needed” or IPv6 “Packet Too Big.”
- Review fragmentation handling: Check whether the IPsec devices can fragment before encryption or reassemble fragments correctly. Behavior varies by platform and configuration.
Avoid relying on fragmentation as the normal solution. Fragmented traffic is more fragile, consumes additional resources, and may be filtered along the route. Also avoid lowering the MTU more than necessary, since that increases packet counts and can reduce efficiency.
Recommendation
Start with an MTU near 1400 bytes for a typical IPsec tunnel over a 1500-byte path, then verify it with packet-size tests and adjust for the actual encapsulation. Use TCP MSS clamping when TCP traffic still sends oversized segments, and make sure Path MTU Discovery messages can reach the relevant devices. The best setting is the largest MTU that reliably fits across the complete path without fragmentation or drops.
