Friday, June 4, 2021

How to do MTU discovery on Linux and Mac



To find the optimal MTU for your network, you need to find the maximum packet size you can send through it. 

on Mac  use the following command to send ping packets with a MTU size of 1500 :

ping -D -s $((1500-28)) -c 1 1.1.1.1

and on linux use:

ping -M do -D -s $((1500-28)) -c 1 1.1.1.1


To find the default MTU that is set on your device, use the following command on linux 

ip -d link list

and on mac use :

networksetup -getMTU en0

ifconfig should also show the default MTU for your network interfaces.


No comments:

Post a Comment

How to disable Debian 12 sleep on production servers

 Debian 12 has power saver enabled by default which causes your server to go to sleep if there is no mouse / keyboard interaction. To resolv...