Set Manual MTU value

Asked by Michael Weichert

Hello!

How do I manually set the MTU value of an interface using NM and DHCP?

Thanks,
Mike

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu network-manager Edit question
Assignee:
No assignee Edit question
Solved by:
Michael Weichert
Solved:
Last query:
Last reply:
Revision history for this message
Ralph Janke (txwikinger) said :
#1

You can run the following command from a commandline terminal:

sudo ip set link <device> mtu <MTU>

where <device> must be replace with yout network interface (i.e. eth0, eth1 ...) and <MTU> with your chosen size.

However, this will only set the interface until the next reboot.

If you want to set it as a default value you have to add it to the file /etc/network/interfaces. In this file there should be a line starting with iface <devicename> etc. you can add more settings after this lien in the foollowing way if it is static addressing

iface eth0 inet static
                 address 192.168.0.1
                 network 192.168.0.0
                 gateway 192.168.0.254
                 netmask 255.255.255.0
                 mtu 1492

or with dynamic addressing

iface eth0 inet dhcp
                 mtu 1492

I hope this helps

Revision history for this message
Best Michael Weichert (mweichert-furniture) said :
#2

Thanks.

I choose to edit the /etc/network/interfaces file as you suggested and got things working. However, when using DHCP I had to change one thing:

iface eth0 inet dhcp
         pre-up /sbin/ifconfig $IFACE mtu 1492

Thanks again,
Mike

Revision history for this message
EricDHH (ericdhh) said :
#3

Hello

when using 8.10 this fails now. The system mumbled about malformed line in interfaces and use 1500 default.

This is malformed....

auto eth0
#iface eth0 inet dhcp
pre-up /sbin/ifconfig $IFACE mtu 1464

and setting

mtu 1464 like static is malformed too.

What's the goal to get another mtu at boot in intrepid?

Happy Xmas
Eric