View previous topic :: View next topic |
Author |
Message |
elkhunter Tux's lil' helper
Joined: 19 Sep 2004 Posts: 138
|
Posted: Tue Jul 08, 2014 1:50 pm Post subject: how to set MTU on bridged network? |
|
|
I recently switched to using KVM for virtualization and set up a bridged network but now my MTU is back to the default 1500 bytes. How can I configure a larger MTU size to support jumbo frames? I tried adding 'mtu_br0="9000"' but that didn't work. |
|
Back to top |
|
|
elkhunter Tux's lil' helper
Joined: 19 Sep 2004 Posts: 138
|
Posted: Thu Jul 10, 2014 2:21 am Post subject: |
|
|
I was able to set the mtu in /etc/conf.d/net by adding a "net_tap#="9000" line for each tap interface. However to set the mtu for eth0 and br0 I had to add the following script:
cat /etc/local.d/fixmtu.start
ifconfig eth0 mtu 9000
ifconfig br0 mtu 9000
I then updated the VMs and verified I could send 9K pings. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Thu Jul 10, 2014 11:12 am Post subject: |
|
|
elkhunter ...
rather than use local.d you could use a postup() function ...
/etc/conf.d/net
Code: | postup() {
# test condition of some sort ...
if [ ${IFACE} = "eth0" ] ; then
ifconfig eth0 mtu 9000
ifconfig br0 mtu 9000
fi
return 0
} |
best ... khay |
|
Back to top |
|
|
Cyker Veteran
Joined: 15 Jun 2006 Posts: 1746
|
Posted: Thu Jul 10, 2014 11:07 pm Post subject: |
|
|
IIRC, last time I did this I set the mtu for all the component NIC's (e.g. mtu_eth0="9000" mtu_randomudevnamep1s2="9000" etc.) rather than the br0 and it picked up the MTU from the components?
The bridge device seems to take most of its config from the NIC with the lowest MAC address. |
|
Back to top |
|
|
elkhunter Tux's lil' helper
Joined: 19 Sep 2004 Posts: 138
|
Posted: Fri Jul 11, 2014 1:42 pm Post subject: |
|
|
I tried adding the postup() but it didn't work. Both eth0 and br0 still showed a mtu of 1500. The only way I've been able to set them every boot is via the local.d/ script. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Fri Jul 11, 2014 6:58 pm Post subject: |
|
|
elkhunter wrote: | I tried adding the postup() but it didn't work. Both eth0 and br0 still showed a mtu of 1500. The only way I've been able to set them every boot is via the local.d/ script. |
elkhunter ... hmmm, what interface is actually brought up via /etc/init.d/net.*, br0? If this is the case then change the test condition as it will need to match the ${IFACE} ...
Code: | postup() {
# test condition of some sort ...
if [ ${IFACE} = "br0" ] ; then
ifconfig eth0 mtu 9000
ifconfig br0 mtu 9000
fi
return 0
} |
best ... khay |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3095
|
Posted: Sat Jul 12, 2014 10:44 am Post subject: |
|
|
I noticed it's impossible to do that on a bridge that doesn't enslave interfaces with jumbo already enabled.
it will work on a bridge with a device that has jumbo enabled
It won't work on empty bridge
It won't work on a bridge with a device that has jumbo disabled
not tested: bridge with interfaces that have different settings.
Kind of a pitfall |
|
Back to top |
|
|
|