using sys-apps/baselayout-1.11.12-r1 I've created the following configuration: /etc/conf.d/net: ifconfig_eth0=( "null" ) ifconfig_lan=( "192.168.0.2 netmask 255.255.255.0" ) iproute_lan=( "default via 192.168.0.1" ) bridge_lan="eth0" when I start the bridge: # /etc/init.d/net.lan start * Starting lan * Creating bridge lan ... [ ok ] * Adding ports to lan * eth0 ... [ ok ] * Bringing up lan * 192.168.0.2 [ ok ] * Adding routes * default gw 192.168.0.1 dev lan ... [ ok ] The port eth0 is added by net.lan, which, IMHO, should be done by net.eth0 That way I can dynamically add interfaces which aren't available when starting net.lan. ie. # /etc/init.d/net.eth0 start * Starting net.lan * Creating bridge lan ... [ ok ] * Bringing up lan * 192.168.0.2 [ ok ] * Adding routes * default gw 192.168.0.1 dev lan ... [ ok ] * Starting net.eth0 [ ok ] * Adding to lan ... [ ok ] though, DHCP would be problematic using this construction...
*** Bug 64686 has been marked as a duplicate of this bug. ***
I've been thinking about this for some time, and I don't like the idea of dynamically adding interfaces to a bridge. If you define a bridge, all interfaces defined for it should be up. depend_br0() { need net.eth0 net.eth1 } Feel free to re-open if you strongly disagree and can provide a working argument of dynamic bridge - and a patch if you can. PS - Your config can be better written as follows config_eth0=( "null" ) config_lan=( "192.168.0.2 netmask 255.255.255.0" ) routes_lan=( "default via 192.168.0.1" ) Infact, I don't think your config works as you're mixing iproute2 with ifconfig (which is why the new syntax makes no distinction)
Thanks for the configuration suggestions! When I find some time I will try to create a patch... But not now ;-) The argument is from my other bug #64686, bluetooth PAND (from bluez) creates dynamic interfaces which I like to add to the bridge. And it would be handy to add tap/tun devices as well (from qemu/usermode linux/bochs/openvpn). finally, thanks for considering my suggestion ;-)
OK, you've sold me. I'll write a patch
Ok - you can do this when baselayout-1.12.0-alpha3 hits portage
It doesn't seem to work, I guess it is my error, my configuration: /etc/conf.d/net: config_lan=( "192.168.4.2 netmask 255.255.255.0" ) config_eth0=( "null" ) config_bnep0=( "null" ) config_bnep1=( "null" ) config_bnep2=( "null" ) config_bnep3=( "null" ) routes_lan=( "default gw 192.168.4.1 dev lan" ) bridge_lan="eth0" depend_lan() { need net.eth0 net.bnep0 net.bnep1 net.bnep2 } /etc/init.d/net.eth0 start doesn't seem to start net.lan after manually starting net.lan the bridge seems to start but /etc/init.d/net.bnep0 start doesn't add the interface to the bridge.
Is alpha3 in portage yet? No! So you'll have to wait until then. BTW, the way to add to the bridge will be bridge_add_eth0="lan" which will add eth0 to the bridge called lan when eth0 starts
Fixed in baselayout-1.12.0_pre1-r1