From: Friedrich L. <fl...@fl...> - 2004-01-26 11:50:21
|
Hi Arnaud! Arnaud Gomes-do-Vale wrote on 19.01.2004 16:24 MET: > > Here is a patch that adds support for ethernet bonding in 1.0.x (CVS > as of the end of last week). It has not been heavily tested "as is", > but it should work, as it is a cleaner version of a patch that has > been running on a production box for a few weeks now. Enjoy! First I have to tell you that features will not be added to 1.0.x but to 1.1.x. They might be back-ported if they are stable in the 1.1.x branch, but no promises. Second, please mail patches inline so it's easier to commment on them. >-------------------------------------------------------------------------------- > diff -urN build/config/etc/init.d/network build-ircam/config/etc/init.d/network > --- build/config/etc/init.d/network 2003-09-18 20:14:29.000000000 +0200 > +++ build-ircam/config/etc/init.d/network 2004-01-16 12:47:56.000000000 +0100 > @@ -124,6 +124,8 @@ > MAC= > ROUTE= > BR_IF= > + MASTER= > + SLAVE= > > # > # Load the variables from interface config file > @@ -214,6 +216,12 @@ > route add -$CMD ${target} ${netmask:+netmask $netmask} ${gateway:+gw $gateway} dev $DEVICE > done > fi > + > + # Bonding. > + if [ "$SLAVE" = "yes" -a -n "$MASTER" ]; then > + ifenslave -v "$MASTER" $DEVICE > + ip route flush dev $DEVICE > + fi > fi > } I think you can just drop the SLAVE because if MASTER is set to something then you can assume that this is a bonding interface. "SLAVE=no" and "MASTER=bond0" makes no sense, does it? > @@ -280,7 +288,22 @@ > test -x $VLAN && $VLAN set_name_type VLAN_PLUS_VID_NO_PAD &> /dev/null > > # > - # physical interfaces are brought up first > + # bonding interfaces are brought up before physical interfaces >... > diff -urN build/config/etc/sysconfig/nic/ifcfg-bond0.sample build-ircam/config/etc/sysconfig/nic/ifcfg-bond0.sample > --- build/config/etc/sysconfig/nic/ifcfg-bond0.sample 1970-01-01 01:00:00.000000000 +0100 > +++ build-ircam/config/etc/sysconfig/nic/ifcfg-bond0.sample 2004-01-16 12:57:33.000000000 +0100 > @@ -0,0 +1,15 @@ > +# > +# example for a BONDING INTERFACE > +# see also > +# ifcfg-eth4.sample and > +# ifcfg-eth5.sample > +# > +DHCP=no > +ONBOOT=yes > +DEVICE=bond0 > +IP=192.168.103.1 > +NETMASK=255.255.255.252 > +BROADCAST=192.168.103.3 > +MODULE=bonding > +ROUTE="172.18.0.0/255.255.0.0:192.168.103.2" > + A little problem I see is in the order of setting up the bonding device. We set it up before physical interfaces are added to it. What if DHCP is set to "yes"? If there are no physical interfaces DHCP will first run into a timeout. So getting an IP on this interface is propably slower than on a physical ones. Can we do it like the vlan/bridge interfaces, first getting the physical interfaces up and then adding them to the bonding device? > diff -urN build/config/etc/sysconfig/nic/ifcfg-eth4.sample build-ircam/config/etc/sysconfig/nic/ifcfg-eth4.sample > --- build/config/etc/sysconfig/nic/ifcfg-eth4.sample 1970-01-01 01:00:00.000000000 +0100 > +++ build-ircam/config/etc/sysconfig/nic/ifcfg-eth4.sample 2004-01-16 12:58:47.000000000 +0100 > @@ -0,0 +1,13 @@ > +# > +# example for a SLAVE INTERFACE for BONDING > +# see also > +# ifcfg-eth5.sample and > +# ifcfg-bond0.sample > +# > +DHCP=no > +ONBOOT=yes > +DEVICE=eth4 > +MASTER=bond0 > +SLAVE=yes > +MODULE=tulip > + See above MASTER=bond0 should be enough to detect a device to be bonded. -- MfG / Regards Friedrich Lobenstock ____________________________________________________________________ Friedrich Lobenstock Linux Services Lobenstock URL: http://www.lsl.at/ Email: fl...@fl... ____________________________________________________________________ |