VPN推荐评测
VPN

IPsec MTU: How to Calculate and Troubleshoot the Right Size

宋知遥··7 min
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.

nord-vpn-microsoft-edge
nord-vpn-microsoft-edge

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.

NordVPN — fast, secure VPN

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 transportOuter IP headerIPsec overhead to account forInner packetMTU implication
IPv4 transport modeIPv4 headerESP, authentication, and optional paddingOriginal IP packetSubtract overhead from path MTU
IPv6 transport modeIPv6 headerESP, authentication, and optional paddingOriginal IP packetSubtract overhead from path MTU
IPv4 tunnel modeIPv4 headerESP, authentication, padding, and new outer headerEncapsulated IP packetLess room for the inner packet
IPv6 tunnel modeIPv6 headerESP, authentication, padding, and new outer headerEncapsulated IP packetLess room for the inner packet
ESP with AES-GCMOuter IP headerESP header, IV, tag, and paddingProtected packetInclude cipher-specific overhead
ESP with CBC encryptionOuter IP headerESP header, IV, authentication data, and paddingProtected packetInclude cipher-specific overhead
NAT traversalOuter IP headerIPsec overhead plus UDP encapsulationProtected packetUDP adds more overhead
Path with variable headersIPv4 or IPv6 headerTunnels, options, or other encapsulationInner packetMeasure 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.

IPsec MTU: How to Calculate and Troubleshoot the Right Size: Checklist

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

MethodWhat to doWhat it revealsLimitationBest use
Calculate from path MTUSubtract outer and IPsec overheadEstimated tunnel MTUDepends on exact configurationInitial sizing
Check interface settingsInspect tunnel and physical interfacesConfigured MTU valuesMay not reveal the path limitConfiguration review
Ping with “do not fragment”Test progressively larger packetsLargest packet that passesICMP may be filteredReachable-path testing
Use packet captureCompare packet sizes and fragmentationActual encapsulated trafficRequires access to capture pointsDetailed diagnosis
Test TCP MSSTransfer data with different MSS valuesWhether TCP fits the tunnelDoes not test all protocolsTCP-specific issues
Check both directionsTest traffic from each endpointDirection-specific limitsRequires access to both sidesAsymmetric paths
Repeat after route changesRe-test the path after changesWhether the limit has shiftedResults can vary over timeDynamic 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.

IPsec MTU: How to Calculate and Troubleshoot the Right Size: Key points

Match symptoms to likely IPsec MTU fixes

SymptomLikely causeFirst checkPossible fixVerify with
Small pings work, large ones failPacket exceeds path MTUTest with DF setLower tunnel MTULarge-packet ping
TCP connection starts but stallsMSS is too largeInspect SYN MSS valuesClamp TCP MSSSustained transfer
Some websites load partiallyLarge packets are droppedCompare affected pathsLower MTU or enable PMTUDRepeat page request
VPN works in one direction onlyAsymmetric path MTUTest each directionAdjust the affected pathBidirectional tests
Fragmentation appears unexpectedlyTunnel MTU is too highCapture outer packetsReduce tunnel MTUPacket capture
PMTUD does not convergeICMP errors are blockedCheck ICMP filteringPermit required ICMP messagesDF ping tests
Only tunneled traffic failsEncapsulation overhead was missedReview IPsec mode and transformsRecalculate tunnel MTUTunnel traffic tests
Fix works for TCP but not UDPMSS adjustment applies only to TCPTest UDP packet sizesReduce MTU or address UDP sizingUDP 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.

© 2026 信远网络评测 · Xinyuan Net Review Ltd.