Networking: ping: local error: message too long, mtu=1500 / Packet needs to be fragmented but DF set
A packet is larger than the path MTU and is marked "don't fragment", so a router discards it.
Frag needed and DF setPacket needs to be fragmented but DF setping: local error: message too long, mtu=1500Message too long mtuICMP fragmentation needed and DF set Meaning
Find the real path MTU with ping -M do -s 1472 host (Linux) or ping -f -l 1472 host (Windows) and lower the size until it works. Fix by setting a smaller MTU/MSS on the VPN or tunnel interface (e.g. 1400), or by allowing ICMP type 3 code 4 so path MTU discovery works.
Common causes
- Tunnel/VPN/PPPoE with a smaller MTU than 1500
- ICMP "fragmentation needed" blocked by a firewall
- Jumbo frames enabled on only part of the path
- Wrong MTU set on one interface
- Overlay networks (VXLAN, WireGuard) adding headers
⚡ Quick fix
- Probe:
ping -M do -s 1472 host - Set MTU or MSS clamping (
iptables ... --clamp-mss-to-pmtu) - Allow ICMP type 3 code 4 through firewalls
Detailed fix by platform
Linux
- bash
ping -M do -s 1472 -c 3 example.com sudo ip link set dev wg0 mtu 1380
How to diagnose
- Largest ping size — Which passes?
- Tunnel MTU — Reduced?
- ICMP frag-needed — Allowed?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 1033 Cloudflare Error 1033: Argo Tunnel error (Cloudflare Tunnel not connected)
- cloudflared Unable to reach the origin service cloudflared: Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared (502)
- Connections hang on large transfers (PMTU black hole) Networking: SSH/HTTPS connects but hangs on large data — path MTU discovery black hole
Most viewed in Networking
- Native VLAN mismatch / wrong VLAN, no connectivity Networking: %CDP-4-NATIVE_VLAN_MISMATCH / device on the wrong VLAN can't reach the gateway
- Port err-disabled (psecure-violation) Networking: %PM-4-ERR_DISABLE: psecure-violation error detected on Gi0/5, putting Gi0/5 in err-disable state
- Rogue DHCP server hands out wrong gateway/DNS Networking: Clients receive the wrong default gateway or DNS server — a rogue DHCP server (often a home router) answers first
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026