Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 93321 - networkinterfaces are added by bridge initscript instead of interface initscript
Summary: networkinterfaces are added by bridge initscript instead of interface initscript
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Other
: High enhancement (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
: 64686 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-20 05:10 UTC by Dick Marinus
Modified: 2005-07-19 14:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dick Marinus 2005-05-20 05:10:11 UTC
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...
Comment 1 Dick Marinus 2005-05-20 06:15:30 UTC
*** Bug 64686 has been marked as a duplicate of this bug. ***
Comment 2 Roy Marples (RETIRED) gentoo-dev 2005-06-20 13:53:53 UTC
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)
Comment 3 Dick Marinus 2005-06-20 14:22:30 UTC
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 ;-)
Comment 4 Roy Marples (RETIRED) gentoo-dev 2005-06-21 01:28:09 UTC
OK, you've sold me.

I'll write a patch
Comment 5 Roy Marples (RETIRED) gentoo-dev 2005-06-21 04:56:29 UTC
Ok - you can do this when baselayout-1.12.0-alpha3 hits portage
Comment 6 Dick Marinus 2005-06-30 10:30:47 UTC
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.
Comment 7 Roy Marples (RETIRED) gentoo-dev 2005-06-30 12:32:44 UTC
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
Comment 8 Roy Marples (RETIRED) gentoo-dev 2005-07-19 14:02:02 UTC
Fixed in baselayout-1.12.0_pre1-r1