
Linux MTU Troubleshooting: Fix MTU Mismatch and Path MTU Discovery Problems
Linux MTU troubleshooting is an important skill when diagnosing network connectivity problems, slow transfers, VPN connectivity issues, and unexpected packet drops. A network connection may appear to work normally with small packets but fail when an application sends larger amounts of data. In some cases, SSH sessions remain stable while file transfers, websites, or other TCP applications become slow or stop responding.
One possible cause is an incorrect Maximum Transmission Unit (MTU) or a Path MTU Discovery (PMTUD) failure.
Linux provides several tools for investigating these problems, including ip, ping, tracepath, and tcpdump. By combining these tools, administrators can identify interface MTU settings, test packet sizes, discover path MTU limitations, and determine whether ICMP messages are being blocked.
This guide explains how MTU works, how to diagnose MTU mismatches on Linux, and how to fix common problems without making unnecessary changes to the network.
1. What Is MTU in Linux?
The Maximum Transmission Unit (MTU) is the maximum size of an IP packet that can be transmitted over a network link without fragmentation at that layer.
For a standard Ethernet interface, the commonly used IP MTU is 1500 bytes. However, the supported value can differ depending on the network technology, encapsulation, and device configuration.
For example:
| Network environment | Common MTU value |
|---|---|
| Standard Ethernet | 1500 |
| PPPoE | 1492 |
| Some VPN configurations | 1400 or lower |
| Jumbo-frame Ethernet | 9000 |
| IPv6 minimum link MTU | 1280 |
These are examples, not universal settings. The correct MTU depends on what every relevant part of the network can support.
MTU vs. Path MTU vs. MSS
These three terms are related but describe different things:
- MTU: The maximum IP packet size supported by a particular network link.
- Path MTU (PMTU): The smallest MTU across all links between the source and destination.
- TCP MSS: The maximum TCP data payload advertised by a TCP endpoint, excluding the IP and TCP headers.
For example, if a TCP connection uses IPv4 over a path with an MTU of 1500 bytes, the common TCP MSS calculation is:
1500 - 20 (IPv4 header) - 20 (TCP header) = 1460 bytes
TCP options can affect the amount of application data carried in an individual packet, so this calculation is a basic example rather than a guarantee for every packet.
Understanding these differences helps prevent incorrect MTU changes when troubleshooting network performance.
2. Common Symptoms of Linux MTU Problems
An MTU problem does not always cause a complete network outage. Some of the most confusing cases occur when small packets work but larger packets fail.
Common symptoms include:
- Websites load partially or remain stuck during loading.
- SSH connections work, but large file transfers fail.
- VPN connections establish successfully, but applications behave unpredictably.
- TCP connections complete the initial handshake but stop transferring data.
- Large ping packets fail while smaller ping packets succeed.
- Network performance becomes inconsistent across different destinations.
- Applications report timeouts or intermittent connection failures.
One particularly important symptom is a TCP connection that starts successfully but stops making progress when larger data segments are transmitted.
This behavior can indicate a Path MTU Discovery black hole, especially when the network is not delivering the ICMP messages required to report that a packet is too large.
3. How to Check the MTU of a Linux Interface
Start by identifying the network interfaces and their current MTU values.
Run:
ip -br linkExample output:
lo UNKNOWN 65536
eth0 UP 1500
ens192 UP 1500
tun0 UNKNOWN 1400The output provides a quick overview of the interface names, operational states, and MTU values.
To inspect one interface in more detail, use:
ip link show dev eth0Example output:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP>
mtu 1500
qdisc fq_codel state UP
mode DEFAULTTo inspect packet and error counters, run:
ip -s link show dev eth0Pay attention to dropped packets and errors, but do not assume that every drop is caused by an MTU problem. Interface counters can have several possible causes.
Also inspect the route selected for the destination:
ip route get 198.51.100.20Replace the example address with the real destination IP address.
This command helps identify the outgoing interface, gateway, and selected route. It can also show route-specific MTU information when such information is configured.
4. How to Test MTU Using ping -M do
The Linux ping command can test whether packets of a particular size can travel to a destination without IPv4 fragmentation.
For IPv4, the -M do option requests Path MTU Discovery and prevents local fragmentation of the probe.
For a standard 1500-byte MTU, the ICMP payload should be 1472 bytes:
1500 - 20 (IPv4 header) - 8 (ICMP header) = 1472Run:
ping -4 -M do -s 1472 -c 4 198.51.100.20Replace 198.51.100.20 with the destination you want to test.
If the path supports the packet size and the destination responds to ICMP Echo, the command may return output similar to:
64 bytes from 198.51.100.20: icmp_seq=1 ttl=56 time=24.3 ms
64 bytes from 198.51.100.20: icmp_seq=2 ttl=56 time=23.9 ms
64 bytes from 198.51.100.20: icmp_seq=3 ttl=56 time=24.1 ms
64 bytes from 198.51.100.20: icmp_seq=4 ttl=56 time=24.0 msThe displayed 64 bytes is the normal response size; the command-line -s 1472 specifies the outgoing Echo Request payload.
What If the Test Fails?
You may receive an error indicating that the packet needs fragmentation or is too large.
Try a smaller payload:
ping -4 -M do -s 1450 -c 4 198.51.100.20Continue testing with smaller or larger payloads until you find the largest size that works consistently.
The corresponding IPv4 packet size is:
ICMP payload + 28 bytes
For example:
| Ping payload | Total IPv4 packet size |
|---|---|
| 1472 | 1500 |
| 1450 | 1478 |
| 1400 | 1428 |
| 1372 | 1400 |
If a 1472-byte payload fails but a 1372-byte payload succeeds, investigate whether the path MTU is lower than 1500.
Important: A failed ping test does not automatically prove an MTU problem. The destination or a firewall may block ICMP Echo, and packet loss can have other causes. Combine this test with tracepath and other network diagnostics.
5. How to Find Path MTU Using tracepath
The tracepath utility is useful when investigating the MTU of a route between two systems.
Unlike a simple interface MTU check, it attempts to discover MTU information along the network path.
Run:
tracepath 198.51.100.20To use IPv4 explicitly:
tracepath -4 198.51.100.20For IPv6:
tracepath -6 2001:db8::10The example addresses are documentation-only addresses. Replace them with real destinations.
An illustrative output might look like:
1?: [LOCALHOST] pmtu 1500
1: 192.168.1.1 1.120ms
2: 10.10.10.1 8.340ms
3: 203.0.113.1 18.520ms pmtu 1450
4: 203.0.113.10 22.100ms reached
Resume: pmtu 1450 hops 4 back 4The important information is the pmtu value.
In this illustrative example, the discovered path MTU changes from 1500 to 1450 along the route.
Useful options include:
| Option | Description |
|---|---|
-4 | Use IPv4 only |
-6 | Use IPv6 only |
-n | Display numerical addresses |
-b | Display hostnames and addresses |
-m | Set the maximum number of hops |
-l | Set the initial packet length |
For example:
tracepath -n -m 20 198.51.100.20tracepath is not guaranteed to reveal every path limitation. Some routers do not return all the information needed for MTU discovery, particularly in certain IPv4 environments.
For additional information, see the Linux tracepath(8) manual page.
6. Understanding Path MTU Discovery (PMTUD)
Path MTU Discovery allows a host to determine the largest packet size that can travel across a particular network path without requiring fragmentation by intermediate routers.
The path MTU is determined by the smallest supported MTU across the links in that path.
Consider this example:
Linux Server
|
| MTU 1500
|
Router A
|
| MTU 1500
|
Router B
|
| MTU 1400
|
Router C
|
| MTU 1500
|
Destination ServerAlthough most links support an MTU of 1500, one link supports only 1400.
Therefore:
Path MTU = 1400 bytes
The sending host must adapt its packet size to the path limitation.
IPv4 Path MTU Discovery
For IPv4, a host can send packets with the Don’t Fragment (DF) bit set.
If a router cannot forward a packet because it exceeds the outgoing link MTU, it should return an ICMP Destination Unreachable message indicating that fragmentation is needed.
The source host can use this information to reduce its packet size.
IPv6 Path MTU Discovery
IPv6 works differently from IPv4.
Routers do not fragment IPv6 packets in transit. Instead, the source node is responsible for fragmentation when needed, and Path MTU Discovery relies on ICMPv6 Packet Too Big messages to communicate path limitations.
The minimum IPv6 link MTU is 1280 bytes.
Blocking the required ICMPv6 messages can therefore cause connectivity problems, especially when applications send packets larger than the path can support.
For the protocol details, see RFC 8201: Path MTU Discovery for IPv6.
7. How to Diagnose PMTUD Black Hole Problems
A Path MTU Discovery black hole occurs when packets exceed the path MTU but the sender does not receive the ICMP messages needed to adjust their size.
The result can be confusing:
- Small packets reach the destination.
- The TCP handshake succeeds.
- Interactive sessions may work.
- Large transfers fail or stop progressing.
This can happen when firewalls or network devices incorrectly block the ICMP messages required for Path MTU Discovery.
Step 1: Compare Small and Large Ping Packets
Start with a small packet:
ping -4 -M do -s 1000 -c 4 198.51.100.20Then test a larger one:
ping -4 -M do -s 1472 -c 4 198.51.100.20If the small test succeeds but the larger one fails, investigate the MTU along the path.
Step 2: Run tracepath
tracepath -4 198.51.100.20Look for changes in the reported PMTU and identify where the path may be constrained.
Step 3: Inspect ICMP Messages
Use tcpdump to monitor ICMP traffic:
sudo tcpdump -ni any 'icmp or icmp6'For IPv4, pay attention to messages indicating that fragmentation is needed.
For IPv6, look for ICMPv6 Packet Too Big messages.
If the network drops these messages, the source system may not learn that it needs to send smaller packets.
Step 4: Test the Reverse Direction
MTU testing should not be limited to one direction.
Run the appropriate tests from the remote system back toward the original Linux host whenever possible.
The forward and reverse paths may have different network devices, routes, or MTU limitations.
Red Hat also emphasizes testing both directions when verifying path MTU.
8. How to Fix MTU Mismatch on Linux Interfaces
After identifying the affected interface and confirming the appropriate MTU, you can test a new value.
For example, to temporarily set the MTU of eth0 to 1400 bytes:
sudo ip link set dev eth0 mtu 1400Verify the change:
ip link show dev eth0The output should show:
mtu 1400Test connectivity again:
ping -4 -M do -s 1372 -c 4 198.51.100.20The payload of 1372 bytes plus the 28-byte IPv4 and ICMP headers produces a 1400-byte packet.
If the new configuration resolves the issue, investigate the correct persistent configuration method for the Linux distribution and network manager.
Make the MTU Change Persistent with NetworkManager
The ip link set command changes the running interface configuration. The setting may be lost after a reboot or connection restart.
On systems managed by NetworkManager, first identify the active connection profile:
nmcli connection show --activeThen modify the Ethernet MTU setting:
sudo nmcli connection modify "Wired connection 1" 802-3-ethernet.mtu 1400Replace Wired connection 1 with the actual connection profile name.
Activate the profile:
sudo nmcli connection up "Wired connection 1"Verify the active interface MTU:
ip link show dev eth0Warning: Re-activating a network profile can interrupt network connectivity. When configuring a remote server over SSH, make sure you have console or out-of-band access before applying network changes.
NetworkManager properties can differ for Ethernet, bridges, bonds, VLANs, and tunnel connections. Use the property appropriate for the connection type.
See the NetworkManager settings reference.
9. MTU Problems in VPNs, VLANs, and Tunnels
MTU problems frequently appear in networks that use encapsulation.
A tunnel adds additional headers to the original packet. These headers consume part of the available packet size, leaving less room for the inner packet.
For example:
Original IP Packet
|
v
Tunnel Encapsulation
|
v
Additional Headers
|
v
Outer IP Packet
|
v
Physical NetworkIf the outer packet exceeds the underlay path MTU, it may be dropped or require the source to reduce its packet size.
VPN MTU Problems
VPN technologies such as IPsec and other tunnel-based solutions introduce encapsulation overhead.
The correct tunnel MTU depends on the protocol, encryption mode, address family, and underlying network.
Do not assume that every VPN should use an MTU of 1400. Measure the path and calculate the available space for the encapsulated packet.
For background on VPN technologies, see VPNs Explained.
VLAN MTU Problems
VLAN tagging adds Layer 2 overhead to Ethernet frames.
A VLAN tag does not automatically mean that the IP MTU must be reduced. The Ethernet devices and links must support the tagged frame size required by the configuration.
Check the MTU on the physical interface, VLAN interface, and relevant switch ports.
Tunnel and Overlay Networks
Technologies such as GRE, VXLAN, and other overlay networks add encapsulation overhead.
When configuring them, verify both the underlay MTU and the effective MTU available to the inner network.
A mismatch between the physical network and tunnel configuration can produce symptoms that look like application or routing problems.
10. TCP MSS Clamping: When and Why to Use It
Maximum Segment Size (MSS) clamping is a technique used on routers and firewalls to adjust the MSS value advertised in TCP connection setup packets.
It can help prevent TCP segments from becoming too large for a path with a reduced MTU.
For a basic IPv4 example:
Path MTU: 1400 bytes
IPv4 header: 20 bytes
TCP header: 20 bytes
TCP MSS: 1360 bytesThis is the common base-header calculation; TCP options can affect the actual data available in individual segments.
A router or firewall may use a TCP MSS clamping rule to adjust the advertised value based on the path MTU.
For example, on an IPv4 Linux router using iptables, a rule can look like this:
sudo iptables -t mangle -A FORWARD \
-p tcp --tcp-flags SYN,RST SYN \
-j TCPMSS --clamp-mss-to-pmtuThis example applies to forwarded TCP traffic passing through the router. It does not automatically configure every local or forwarded connection in every network design.
MSS clamping can be useful when a tunnel or constrained WAN path creates a smaller effective MTU. However, it should not be treated as a replacement for correcting broken PMTUD or blocked ICMP messages.
Apply firewall changes only after understanding the traffic path and the existing firewall policy.
11. Common MTU Troubleshooting Mistakes
Avoid these mistakes when diagnosing Linux MTU problems:
1. Changing the MTU without testing the path
Reducing the MTU may hide the original problem while creating unnecessary overhead. Identify the actual path limitation first.
2. Assuming that a failed ping proves an MTU problem
ICMP Echo traffic may be blocked or rate-limited. Use tracepath, packet captures, and application-level tests to gather more evidence.
3. Blocking all ICMP traffic
ICMP and ICMPv6 carry important network error messages, including those used by Path MTU Discovery. Restricting them indiscriminately can create connectivity failures.
4. Ignoring tunnel overhead
The MTU of a physical Ethernet interface does not automatically represent the MTU available to traffic inside a VPN or overlay tunnel.
5. Testing in only one direction
Asymmetric routes can produce different results in each direction. Test from both endpoints when possible.
6. Applying a temporary MTU change and assuming it is permanent
A change made with ip link set may disappear after the interface is restarted. Use the appropriate persistent network configuration.
7. Confusing interface MTU with Path MTU
An interface may have an MTU of 1500 while the complete path supports only 1400. Both values matter during troubleshooting.
12. Frequently Asked Questions
What is the default MTU in Linux?
There is no single MTU value that applies to every Linux interface. Standard Ethernet commonly uses 1500 bytes, but the configured value depends on the interface type and network environment.
How do I check MTU in Linux?
Run:
ip link showTo inspect one interface:
ip link show dev eth0How do I test MTU with ping in Linux?
For a standard 1500-byte IPv4 MTU, test with:
ping -4 -M do -s 1472 -c 4 198.51.100.20The 1472-byte payload plus the IPv4 and ICMP headers totals 1500 bytes.
What is the difference between MTU and PMTU?
MTU describes the maximum IP packet size supported by a specific link. PMTU describes the smallest MTU across the route between the source and destination.
Why does ping work while TCP transfers fail?
Small packets may fit through a network path while larger packets do not. If the ICMP messages needed for Path MTU Discovery are blocked, TCP connections may stop progressing when larger packets are transmitted.
Can a VPN cause MTU problems?
Yes. VPN encapsulation introduces additional headers, reducing the space available for the original packet. The tunnel MTU must account for the additional overhead and the underlay path MTU.
Should I set every Linux interface to MTU 1400?
No. The correct value depends on the network technology and the actual path. A lower MTU is not automatically better and should not be applied without testing.
Does IPv6 use the same MTU troubleshooting method as IPv4?
The diagnostic tools are similar, but the packet-handling rules differ. IPv6 routers do not fragment packets in transit, and IPv6 Path MTU Discovery relies on ICMPv6 Packet Too Big messages.
13. Conclusion
Linux MTU troubleshooting requires more than checking the MTU value of a network interface. Administrators must also consider the complete path, tunnel encapsulation, ICMP behavior, and the difference between link MTU and Path MTU.
Tools such as ip, ping, tracepath, and tcpdump provide a practical way to identify packet-size limitations and investigate PMTUD failures.
Start by checking the interface configuration, test packet sizes, discover the path MTU, and inspect ICMP messages. Then apply the smallest necessary configuration change and verify the result in both directions.
A systematic approach helps resolve MTU mismatches without unnecessarily changing unrelated network settings.