11

I have to gigabit network interfaces which I have bridged.

/etc/network/interfaces is:

 auto lo
 iface lo inet loopback

# Set up interfaces manually, avoiding conflicts with, e.g., network manager
 iface eth0 inet manual

 iface eth1 inet manual

 # Bridge setup
 auto br0
 iface br0 inet static
    bridge_ports eth0 eth1
    address 192.168.88.2
    broadcast 192.168.88.255
    netmask 255.255.255.0
    gateway 192.168.88.254
    dns-nameservers 192.168.88.254

But the MTU is only 1500

myth@myth:~$ traceroute --mtu 192.168.88.1
traceroute to 192.168.88.1 (192.168.88.1), 30 hops max, 65000 byte packets
 1  RoboStation.local (192.168.88.1)  0.278 ms F=1500  0.279 ms  0.287 ms

If I run the following commands:

myth@myth:~$ sudo ifconfig eth0 mtu 9000
myth@myth:~$ sudo ifconfig eth1 mtu 9000
myth@myth:~$ traceroute --mtu 192.168.88.1

traceroute to 192.168.88.1 (192.168.88.1), 30 hops max, 65000 byte packets
 1  RoboStation.local (192.168.88.1)  0.407 ms F=9000  0.422 ms  0.383 ms

Now I have MTU of 9000 and transfers to my NAS are MUCH faster

But, I thought I would just do this in the /etc/network/interfaces file:

 auto lo
 iface lo inet loopback

 # Set up interfaces manually, avoiding conflicts with, e.g., network manager
 iface eth0 inet manual
    mtu 9000

 iface eth1 inet manual
    mtu 9000

 # Bridge setup
 auto br0
 iface br0 inet static
    bridge_ports eth0 eth1
    address 192.168.88.2
    broadcast 192.168.88.255
    netmask 255.255.255.0
    gateway 192.168.88.254
    dns-nameservers 192.168.88.254
    mtu 9000

But the network just fails to come up at boot

I removed the mtu 9000 from the br0 section and the PC boots with the network coming up, but the MTU is still 9000

How do I set the MTU to 9000 for eth0 and eth1 at boot so the bridge runs at 9000?

Also is there a way to test /etc/network/interfaces without rebooting all the time?

1 Answer 1

10

Looks like the mtu option is not available when using the manual method (see interfaces(5)). So, here's what is supposed to work (incorporating the feedback from the comments):

auto lo
iface lo inet loopback

# Set up interfaces manually, avoiding conflicts with, e.g., network manager
iface eth0 inet manual
   # nothing here

iface eth1 inet manual
   # nothing here

# Bridge setup
auto br0
iface br0 inet static
   bridge_ports eth0 eth1
   address 192.168.88.2
   ...
   post-up ifconfig eth0 mtu 9000 && ifconfig eth1 mtu 9000

Using the up (or in this case post-up) option we can specify our own command to run during (of after) the time the interface is brought up.

5
  • 1
    The bridge itself just seems to take the smallest MTU from it's set of hosted devices and uses that. MTU on br0 in the interfaces file causes the networking to fail to start on boot.
    – RoboJ1M
    Apr 9, 2013 at 8:57
  • However I did manage to solve it last night, using almost exactly this solution. I added: post-up ifconfig eth0 mtu 9000 at the end of the br0 section, twice, both for eth0 and eth1.
    – RoboJ1M
    Apr 9, 2013 at 8:58
  • @RoboJ1M Thanks, I've updated my answer.
    – gertvdijk
    Apr 9, 2013 at 9:53
  • if you don't have ifconfig, use ip link: post-up ip link set dev eth0 mtu 9000 Apr 29, 2014 at 22:09
  • My impression (I may well be wrong) is that the mtu option should be supported in the manual method (certainly the man page on 14.04 doesn't suggest it isn't) and that the issue is probably more related to this bug (see comment #4 in particular). Quite likely this is fixed in 16.04 as a by-product of the systemd migration
    – sxc731
    Sep 4, 2016 at 18:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .