I have some Ubuntu 14.04 machines running in an Amazon VPC. When they start, they have an MTU of 9001, but this appears to cause some problems when communicating with other servers which have an MTU of 1500. When I use ip link set dev eth0 mtu 1500
these problems go away.
The problem is I can't seem to hit upon the correct way to make this permanent.
/etc/network/interfaces.d/eth0.cfg
looks like this
auto eth0
iface eth0 inet dhcp
pre-up /sbin/ip link set dev eth0 mtu 1500
I've also tried adding mtu 1500
to bottom of that stanza too.
If I reboot, the machine comes back up with an MTU of 1500.
So what's the correct way to do this?
Best Answer
Ran Rubinstein got me on the right track with this ubuntu forum thread.
The MTU is being set by DHCP, but we can override that with some changes to /etc/dhcp/dhclient.conf - here's how mine looks
Having added these lines, I rebooted the machine to double check, and it came up with an MTU of 1500