I'm running Ubuntu Server 12.04 LTS, and I want to override the MTU my cable company provides via DHCP. They provide an MTU of 576 and I want to use 1492. I can change it with ifconfig
, but it won't persist across reboots. I tried to edit the file /etc/network/interfaces
, but the setting gets ignored on the interface (the MTU setting works on the internal interface that uses a static IP address). How can I make the interface force an MTU of 1492 even when it is provided with an MTU via DHCP?
2 Answers
Edit the interfaces file to set the mtu when the interface comes up:
$ sudo vi /etc/network/interfaces
Edit the file so it includes the post-up line:
iface eth0 inet dhcp
. . .
post-up /sbin/ifconfig eth0 mtu 1500
Remove the interface-mtu option from /etc/dhcp/dhclient.conf and it will set 1500 as standard. This is due to erroneous setting of 576 being received from the ISP DHCP server.
ping -s 1484 somewhere.com
actually work? If so then you should tell your ISP to fix their broken DHCP server. It is supposed to tell you what the maximum size is that they will accept, and so if you try to send anything larger, it will just be ignored.ping -M dont -s 1484
? I forgot that without the-M dont
the packet will just be fragmented to fit into a smaller mtu.tracepath
will also discover the actual mtu.