How to change the default MTU of a network card on Ubuntu
On Ubuntu 8.10, the default MTU of a network card is 1500. Normally, this causes no problem. I have an application called Elluminate which must connect to the network of Laval University with a mtu of 1480. This small tutorial will show you how to change it and also, how can that change be effective even if you restart the computer.
[ad#Widgetbucks]
Change for the session only
To check the MTU of a network card, use the command “ifconfig” as follows :
~$ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:a0:d1:a7:6d:7b
UP BROADCAST MULTICAST MTU:1500 Metric:1
Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:1
collisions:0 lg file transmission:1000
Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B)
Interruption:216
We note that for my part, the MTU of my network card is 1500. Note that if you have a wireless card, there is good chance that the name is wlan0. To change the MTU, you must again use the ifconfig command by adding at the end, the word mtu followed by the new value you want it. Here’s an example:
sudo ifconfig eth0 mtu 1480
We can validate the change by using the ifconfig command again:
~$ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:a0:d1:a7:6d:7b
UP BROADCAST MULTICAST MTU:1480 Metric:1
Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:2
collisions:0 lg file transmission:1000
Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B)
Interruption:216
[ad#Adsense]
Permanent change
To make this change permanent without having to redo this command after each reboot, we need to add a small script to be executed during the computer start-up when the network card become active. To do this, we must first create the script in the “/etc/network/if-up” folder.
You can use gedit, kate or your favorite text editor like this:
sudo gedit /etc/network/if-up.d/mtu
or
sudo kate /etc/network/if-up.d/mtu
Here is the code of the script:
#!/bin/sh
ifconfig eth0 mtu 1480
Again, if you want to change the mtu of your wireless card, his name is probably wlan0. It will therefore change eth0 by wlan0.
Once the script is created, it must be made executable by the system as follows:
sudo chmod 755 /etc/network/if-up.d/mtu
Now, simply reboot and the mtu should be changed!

June 20th, 2009 at 5:11 am
Hi,
thanks for your work!
I would like to ask what could be the cause why suddenly facebook needed a 1492 value and not that of 1500…
Thank you
Byeee
mattia
January 15th, 2010 at 4:14 pm
This fails for mtu >1500. Thts what many high speed applications require
March 22nd, 2010 at 10:41 pm
Thanks very much, this really helped me.
March 11th, 2011 at 5:39 am
What is the point in reducing the MTU?
For me application like Evolution mail, youtube-dl, PUBKEY etc. dont work and I checked the MTU to be 1472. At my work environment the MTU is 1500 and there all these applications work. Is the problem just with the MTU? and would changing that make all of them work for me?
I am just being a bit cautious so that changing it doesn’t disrupt my present scenario!
Also I haven’t understood how to change the MTU permanently. at /etc/network/interfaces the following two lines are written:
auto lo
iface lo inet loopback
What do I change now?
December 20th, 2011 at 8:02 am
To found default netcard eth0, eth1 etc, do
DEV=`netstat -i | awk ‘/eth/ {print $1}’`
ifconfig $DEV mtu 1480