IPsec MTU: How to Choose the Right Size and Troubleshoot Issues

Learn how IPsec affects MTU, how to calculate a safe packet size, and how to diagnose fragmentation and connectivity problems.
IPsec MTU is the largest inner packet size that can pass through an IPsec tunnel without exceeding the available path MTU after IPsec adds its headers, encryption data, and authentication information. Because that overhead varies by configuration, there is no single correct IPsec MTU for every network. A practical approach is to identify the path MTU, account for tunnel overhead, then verify the result with packet tests and real traffic.
Compare common IPsec encapsulation options and their MTU impact
| Encapsulation or setting | Adds overhead? | Typical impact | What to check |
|---|---|---|---|
| ESP tunnel mode | Yes | Reduces inner-packet space | ESP headers and trailer |
| ESP transport mode | Yes | Usually less than tunnel mode | Existing IP header remains |
| AES-GCM | Yes | Includes ESP and authentication data | Cipher and tag configuration |
| AES-CBC with HMAC | Yes | Includes padding and authentication data | Cipher, block size, and integrity |
| UDP encapsulation | Yes | Adds a UDP header | NAT-T enabled or required |
| IPv4 outer header | Yes | Uses part of the path MTU | Outer IP version |
| IPv6 outer header | Yes | Uses more header space than IPv4 | IPv6 path MTU |
| VLAN tagging | Yes | Reduces available link-layer frame space | Whether the path supports the frame size |
Compiled November 2026; check the provider's site for current details.
What MTU means in an IPsec tunnel
The Maximum Transmission Unit, or MTU, is the largest IP packet a network link can carry in one piece. A common Ethernet MTU is 1500 bytes, but the effective path MTU may be lower because of additional encapsulation, provider networks, or other tunnels.
IPsec protects packets by adding information around or within them. In tunnel mode, the original packet is carried inside a new outer IP packet. In transport mode, IPsec protects the original packet without adding a new outer IP header. Either way, the protected packet becomes larger.
If the resulting packet exceeds the path MTU, a router may fragment it, drop it, or send a message that allows the sender to reduce packet size. Fragmentation and blocked messages can cause slower performance or connections that partially work, for example, a website may load its basic page but stall when transferring larger data.
What affects IPsec overhead?
The amount of overhead depends on the IPsec configuration and network path. Important factors include: BIG-IP F5 VPN Download: How to Get and Install the Official Client
- Tunnel mode or transport mode: Tunnel mode adds an outer IP header. Transport mode usually adds less.
- Outer IP version: An IPv6 outer header is larger than an IPv4 outer header.
- Security protocol: ESP and AH have different overhead. ESP is commonly used for encryption.
- Encryption and integrity algorithms: These can add authentication data, padding, and alignment requirements.
- NAT traversal: IPsec traffic carried through UDP, often on port 4500, gains additional encapsulation overhead.
- Other tunnels or link layers: GRE, PPPoE, and provider-specific encapsulation can further reduce the usable packet size.
For ESP, overhead can include an ESP header, an initialization vector or nonce, padding, a trailer, an integrity check value, and the outer IP header. Some components have fixed sizes. Others vary by algorithm or packet length. That is why a rough rule of thumb may help with initial testing but cannot guarantee the correct value.
Choose a method to find a safe IPsec MTU
| Method | Best for | Requires | Result | Limitation |
|---|---|---|---|---|
| Calculate from path MTU | Initial estimate | Path MTU and tunnel overhead | Estimated tunnel MTU | Overhead varies by configuration |
| DF-bit ping | Testing packet size | Peer response to probes | Largest tested packet size | Filtering can obscure results |
| Packet capture | Verifying encapsulation | Capture on tunnel or underlay | Observed headers and packet sizes | Requires capture access |
| Router or firewall counters | Spotting drops | Device diagnostic access | Clues about MTU-related drops | Counters may be nonspecific |
| Application testing | Confirming user impact | Representative traffic | Practical end-to-end behavior | Does not isolate the cause |
| Path MTU discovery | Ongoing adaptation | ICMP feedback across the path | Adjusted packet sizing | ICMP may be blocked |
| Conservative MTU setting | Reducing fragmentation risk | Ability to configure the tunnel | More headroom for overhead | May reduce efficiency |
Compiled November 2026; check the provider's site for current details.
How to calculate a safe IPsec MTU
Start with the smallest MTU along the outer network path. Subtract the maximum IPsec overhead for the specific configuration. The result is the maximum inner packet size that should fit without exceeding that path MTU. Microsoft Edge Browser Extensions VPN: What They Do and How to Choose
Inner MTU = path MTU − maximum IPsec overhead
For example, if the outer path supports 1500 bytes and the configured tunnel adds about 60 bytes of overhead, the inner MTU should be no larger than approximately 1440 bytes. This is only an illustration: actual overhead can differ, especially with NAT traversal, IPv6, and the selected ESP algorithms.
| Setting or condition | Effect on usable inner MTU |
|---|---|
| Larger outer IP header | Reduces the space available for the inner packet |
| NAT traversal over UDP | Adds encapsulation and reduces usable MTU |
| ESP encryption and authentication | Adds headers, trailers, and other data |
| Additional tunneling | Uses more of the path MTU |
| Lower path MTU | Requires a correspondingly smaller inner MTU |
Check the device documentation or IPsec implementation for exact overhead details. When the configuration varies between peers, use the most restrictive combination along the path. Leave room for any additional encapsulation rather than setting the tunnel MTU right at a theoretical maximum.
How to find the right value
First, establish the path MTU between the IPsec endpoints or across the relevant network. Then test traffic through the tunnel, because the usable size may be different from the endpoint-to-endpoint path outside the tunnel. Cisco VPN AnyConnect: How It Works and How to Connect
On systems that support it, send packets with the “do not fragment” option and gradually adjust their size. A successful test at one size and failure at the next larger size can help identify the limit. Remember that some tools count the IP and ICMP headers in the packet size, while others report only the data payload. Account for that difference when interpreting results.
Also verify that Path MTU Discovery is working. It relies on network devices sending appropriate messages when a packet is too large to forward. Firewalls that block these messages can leave senders unaware that they need to reduce packet size. This often causes a “black hole”: small packets work, but larger transfers hang or fail.
Useful checks include:
- Test packet sizes both inside and outside the tunnel.
- Review IPsec interface, tunnel, and route MTU settings.
- Check for packet fragmentation or drops in device counters and logs.
- Confirm that firewalls allow the messages required for Path MTU Discovery.
- Test both directions; MTU limits may differ on each path.
MTU versus TCP MSS
MTU sets a limit on the size of an IP packet. TCP MSS, or Maximum Segment Size, limits the amount of application data carried in a TCP segment. MSS does not include the IP and TCP headers. VPN for Microsoft Edge Free: What Works, What to Check, and How to Choose
TCP MSS clamping can help when Path MTU Discovery is unreliable. A router or firewall adjusts the MSS advertised during a TCP connection setup so that TCP endpoints send smaller segments. The chosen MSS should account for the effective tunnel MTU and the relevant IP and TCP headers.
MSS clamping is not a complete replacement for a correct MTU configuration. It can help TCP connections, but it does not fix oversized UDP traffic or every other protocol. Use it as a targeted workaround or safeguard, while ensuring that the tunnel and path MTU are configured appropriately.
Compare common IPsec MTU symptoms and troubleshooting actions
| Symptom | Possible cause | First check | Useful action |
|---|---|---|---|
| Small packets work, large packets fail | MTU or PMTUD issue | Test progressively larger packets | Lower tunnel MTU |
| Some websites stall | Oversized TCP segments | Compare affected and working flows | Adjust TCP MSS |
| Transfers are slow | Fragmentation or packet loss | Check interface and tunnel counters | Inspect packet sizes |
| One direction fails | Asymmetric path MTUs | Test both traffic directions | Check both endpoints |
| VPN connects but data hangs | ICMP feedback is blocked | Check for “fragmentation needed” messages | Permit required ICMP |
| IPsec packets are fragmented | Tunnel MTU exceeds path capacity | Capture underlay traffic | Reduce MTU or overhead |
| Problem appears after NAT traversal | UDP encapsulation overhead | Confirm NAT-T use | Recalculate safe MTU |
| Issue follows a configuration change | Changed cipher or encapsulation | Compare tunnel settings | Recalculate and retest |
Compiled November 2026; check the provider's site for current details. How to Make a Clash Free Clash of Clans Base
Common symptoms and troubleshooting
An incorrect IPsec MTU may show up as:
- Web pages that begin loading but never finish.
- Large downloads or file transfers that stall.
- VPN connections that work for some applications but not others.
- Repeated fragmentation, retransmissions, or packet drops.
- Problems that occur only when NAT traversal or another tunnel is in use.
When investigating, avoid lowering the MTU by guesswork alone. Confirm the path limit, calculate the configured IPsec overhead, and test the result. If lowering the tunnel MTU resolves the issue, check why discovery or fragmentation was failing before treating the change as final. A very low MTU can increase packet count and reduce efficiency.
Recommendation
Set the IPsec tunnel MTU based on the smallest known path MTU minus the actual overhead of the configured encapsulation, then confirm it with packet-size tests in both directions. Keep Path MTU Discovery messages available where possible, and use TCP MSS clamping as a practical safeguard for TCP, not as a substitute for a sound tunnel MTU.