I'm trying to find a way to check if nic supporting a specific MTU size or not without trying to set it first (actually, I want to find the theoretical maximum MTU on all interfaces on all my servers).

I've inspected all features of ethtool, looked in /sys/class/net, etc, but all I can find is the current MTU value.

Are there a way to see how high MTU can be on interface without trying it?

  • I don't know of any cananonical way to find out what you want, but you must ask yourself why do you want to change the MTU. 9/10 cases, your default MTU is just fine. And there is something to be said about jumbo frames, as seen here : archive.nanog.org/sites/default/files/… – schaiba Nov 14 '19 at 8:06
  • I can answer this question pretty easily: because we are running network appliances and those are asking to provide them with as much MTU as we could in their cluster fabric network, but it should be the same MTU on all servers. So I want to see what number can I make without breaking stuff in the process (so, no trial and error). – George Shuklin Nov 15 '19 at 9:39

you can send a specific mtu size with ping

ping -M do -s <mtu-size> <ip-address>

<ip-address> being the local ip of the interface you wish to check.

Note there is an additional 28 bytes as a header when using this method.

Just keep increasing the mtu size (in the ping command) until you get a Message too long error or similar.

Current MTU setting and IP:

[root@centos7 ~]# ip l  | grep ens37 | awk '{print $4,$5}'
mtu 1500
[root@dev-worker1 ~]# ip addr show ens37 | grep "inet " | awk '{print $2}'

sending a packet larger than the current MTU setting, but is still accepted:

[root@centos7 ~]#  ping -M do -s 8972
PING ( 8972(9000) bytes of data.
8980 bytes from icmp_seq=1 ttl=64 time=0.103 ms
8980 bytes from icmp_seq=2 ttl=64 time=0.067 ms

Sending one too large. Some distros may actually tell you the maximum via this method. E.g Centos7:

[root@centos7 ~]#  ping -M do -s 118972
Error: packet size 118972 is too large. Maximum is 65507

Once done, you can set it to the maximum if that's what you desire using ip link

ip link set <interface name> mtu <mtu value>


  • Clarified I'm referring to pinging a local IP and provided example.
  • I do not know for sure that some distros will output the actual limit, as my testing environment interfaces have max capabilities of 65535 bytes.
  • You completely missed the point of question. I don't need to know what MTU I have on server now (it's in ip l output), I want to know the maximum my hardware is supported. – George Shuklin Nov 15 '19 at 9:37
  • ip l output is indeed what is set. ping -M do -s <mtu-size> <ip-address> ignores the set mtu size and will send a packet to that interface of whatever desired size. if it's too big (not for the current set size, but the interface's maximum capability), it will complain. please see: access.redhat.com/solutions/2440411 – RobotJohnny Nov 20 '19 at 14:03
  • This looks to be rather close. The question now is, where does ping get this maximum value from? – Panki Nov 20 '19 at 14:09
  • it may be just just because 65535 bytes is the absolute maximum it could ever be; therefore 65507 is the max ping can send after the headers. I can't see how it would know for sure until it hit a limit and got a packet too large or similar response the more I think about it – RobotJohnny Nov 20 '19 at 14:22
  • I expected to find some low-level magic of ethtool, or roaming in /sys, but neither have any information on hardware limit for MTU. /sad – George Shuklin Nov 20 '19 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.