Find Max MTU Size on Mac OS X Using Ping (No Fragmentation)
Finding the maximum MTU size on Mac OS X uses the ping command with the no-fragmentation flag. Run `ping -D -s `, incrementing the packet size until ping reports the packet cannot be sent. The largest successful size plus 28 bytes for IP and ICMP headers equals your true MTU ceiling.
If you have ever tried to use jumbo packets, or trace a weird slowness on the network – one of the things that frequently comes up is packet fragmentation. This is basically where a source machine is sending bigger packets than can be consumed along its pathway to a destination machine. This means the packets will need to be split and essentially causes a host of performance issues.
So how do you diagnose this? Well Ping is your friend. It allows you to flag packets to not be fragmented and specify a minimum and maximum packet size. Using this you can simply loop through test packet sizes until a packet fails and then you have your MTU.
The command below sends packets from 1350 to 1520 and increases the packet size by 10 bytes each time.
ping -g 1350 -G 1520 -h 10 -D andrewbaker.ninja