Find your path MTU with ping
Find the largest IPv4 packet that reaches your chosen destination without fragmentation. Run the commands on your computer, on the connection or VPN you want to test.
1. Choose the path you want to measure
Use a destination you control or are allowed to test that responds to ICMP echo requests. For a VPN, choose a host reached through that VPN. Keep the destination, connection, and VPN state the same throughout the test. A router on your LAN measures a different path from a remote application server.
Use one fixed IPv4 address when possible: a hostname may resolve to different servers. If small pings fail, resolve reachability or ICMP filtering first.
2. Start with a small ping, then test 1500 bytes
Replace <destination> with that IPv4 address or hostname. Open PowerShell or Command Prompt on Windows, or a terminal on Linux with iputils ping.
Windows
ping -4 -n 3 -w 2000 <destination>
ping -4 -n 3 -w 2000 -f -l 1472 <destination>-4 selects IPv4; -f sets Don't Fragment; -l sets payload bytes; -n 3 sends three requests; -w 2000 allows two seconds per reply.
Linux (iputils)
ping -4 -c 3 -W 2 <destination>
ping -4 -c 3 -W 2 -M do -s 1472 <destination>-M do sets Don't Fragment and respects kernel path-MTU checks; -s sets payload bytes; -c 3 sends three requests; -W 2 sets a two-second reply timeout. Do not use Windows's -f on Linux: it means flood ping there.
3. Interpret the response
- Replies received
- This payload works in the tested conditions. Repeat it to confirm; a success at 1472 supports a 1500-byte IPv4 packet, but does not prove larger packets fail.
- Fragmentation needed / Packet needs to be fragmented but DF set / Message too long
- The packet is too large for the path, local interface, or kernel's known path MTU. Record this payload as an upper bound, then try a smaller one.
- Request timed out / Destination unreachable / No reply
- Inconclusive for MTU. Filtering, packet loss, routing problems, or blocked ICMP errors may be responsible. Repeat the probe and compare with a smaller working ping; do not treat every timeout as a fragmentation failure.
4. Narrow the boundary
- If 1472 gives an explicit fragmentation error, try 1400, then smaller values until replies are received.
- Keep the largest successful payload and the smallest payload with an explicit fragmentation error. Test the midpoint between them, rounding down. Replace the relevant bound after each result.
- Continue until those bounds differ by one byte. Repeat the successful size and the next byte several times to confirm the boundary.
- If 1472 succeeds, it is sufficient to confirm a 1500-byte packet. Only search above it if your interface and network are configured for larger packets. Otherwise record the result as a demonstrated lower bound.
Example: 1464 replies and 1465 produces a fragmentation error. The observed IPv4 boundary is 1464 + 28 = 1492 bytes.
5. Calculate your observed MTU
Enter the largest payload that received replies.
1472 payload + 20-byte IPv4 header + 8-byte ICMP header. Larger sizes have not been ruled out.
This calculation assumes a standard IPv4 header without IP options. Ethernet framing is not added to the IP MTU. Enter actual observations; the calculator does not verify ping output.
6. Apply the result carefully
There is no single optimal MTU for every destination. Repeat the test for important paths, record whether a VPN was active, and account for the relevant interface or tunnel configuration. A local interface limit can also set your observed boundary. Successful ICMP probes do not guarantee identical behavior for TCP or other protocols.
Use the result as troubleshooting evidence before changing an interface or router setting. Retest connectivity after any deliberate change. This guide does not change network settings.
IPv6 and other operating systems
These commands and the +28 formula are for IPv4. Windows's Don't Fragment option is IPv4-only. IPv6 has different headers and fragmentation behavior; macOS and other ping implementations use different flags. Do not reuse this procedure unchanged.
References & privacy
Microsoft: Windows ping · Linux iputils ping manual
Calculations stay in your browser. You run ping yourself; only those commands send probes to the destination you choose. Cloudflare receives the connection information needed to deliver this page.