39

How can I check the MTU value for my current connection?

In my network connection settings, the MTU is set to automatic and I would like to know wich value was automatic selected for it.

0

3 Answers 3

52
ifconfig

to view the current MTU. Example (just searching for MTU):

ifconfig| grep -i MTU
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
0
45

Alternative method:

ip addr | grep mtu

For example:

 ip addr | grep mtu
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1300 qdisc fq_codel state UP group default qlen 1000
3: wlp4s0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
4: veth0@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc noqueue state UP group default qlen 1000
3
  • Trying to avoid a pure "+1!" response, but this alternate answer deserves some love in modern environments where containerization means the running OS of an application may be stripped of common networking tools, like ipconfig. May 26, 2017 at 22:50
  • 1
    @firo can you please write ip addr instead of ip ad. While abbreviation is possible, I think it's better to use full name in answers.
    – pevik
    Oct 26, 2018 at 7:35
  • 2
    @marcbollinger ipconfig may be "common", but it's also deprecated - the real reason for it being stripped out IMO :) It can omit important information at times, such as secondary IPs; IIRC the method it uses to communicate with the kernel (ioctls) limits the amount of data that can be sent, while the tools in iproute2 use a different method (netlink) with far higher limits.
    – mark999
    Nov 26, 2018 at 17:35
23

You can read the value from the /sys kernel file system:

cat /sys/class/net/<interface>/mtu

Replace <interface> with the name of the interface to query.

2
  • Only this answer of all three worked for me when I needed to check the MTU value on a remote server where issuing both ifconfig and ip commands resulted in message command not found.
    – Theta
    Oct 6, 2020 at 12:10
  • The numbers here seems to be more correct than what ip shows. ip gives maxmtu whereas the number in this file seems to show the actual mtu. I think. Mar 11, 2021 at 15:53

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.