What value should I set my TCP/IP MTU (Max. Transmission Unit) to?

pktsize=1516;for i in $( seq $pktsize -8 1450 ) ; do ping -M do -s $i -c 1 slashdot.org; done
Linux - starting with a packetsize that must be split into two packets, count down by 8 bytes, and try to send the packet using the "Don't Fragment" option. The actual MTU (the size of the actual PING packet) is (in this example) 1460 data bytes + 20 bytes IP header + 8 bytes PING request = 1488
Sample Output
PING slashdot.org (216.34.181.45) 1516(1544) bytes of data.
From wombat.local (192.168.55.10) icmp_seq=1 Frag needed and DF set (mtu = 1500)

--- slashdot.org ping statistics ---
0 packets transmitted, 0 received, +1 errors

... eventually,      note Max pkt .....vvvv that can be sent unsplit
PING slashdot.org (216.34.181.45) 1460(1488) bytes of data.
1468 bytes from slashdot.org (216.34.181.45): icmp_req=1 ttl=244 time=95.1 ms

--- slashdot.org ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 95.137/95.137/95.137/0.000 ms

0
2012-02-21 01:58:07

These Might Interest You

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: