Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to set MTU on bridged network?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
elkhunter
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2004
Posts: 138

PostPosted: Tue Jul 08, 2014 1:50 pm    Post subject: how to set MTU on bridged network? Reply with quote

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
View user's profile Send private message
elkhunter
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2004
Posts: 138

PostPosted: Thu Jul 10, 2014 2:21 am    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Jul 10, 2014 11:12 am    Post subject: Reply with quote

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
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Thu Jul 10, 2014 11:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
elkhunter
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2004
Posts: 138

PostPosted: Fri Jul 11, 2014 1:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri Jul 11, 2014 6:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3095

PostPosted: Sat Jul 12, 2014 10:44 am    Post subject: Reply with quote

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 :roll:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum