Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 400721 - Part about bonding should be reworked
Summary: Part about bonding should be reworked
Alias: None
Product: [OLD] Docs on
Classification: Unclassified
Component: Installation Handbook (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Vermeulen (RETIRED)
Depends on:
Reported: 2012-01-25 10:54 UTC by Xake
Modified: 2013-08-15 08:30 UTC (History)
2 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Xake 2012-01-25 10:54:07 UTC
Ok, this part of the guide is just wrong.

In its current state it says you should configure the bond with a "null" configuration, and then have it depend on net.$iface.

This just breaks.
When net.$iface1 goes up it will do a regular init (dhcp and the whole shebang).
Same goes for net.$iface2.
Then net.bond0 pushes those networks down and then up again.

So what happends here if you have a network without a DHCP server?
First you have to wait for net.eth0 to timeout, then you have to wait for net.eth1 to timeout, then you will not have a working network, since because net.eth* failed, bond0 will not start.

And If net.bond0 will start it will not work since it has not IP-address (which you made sure with config_bond0="null")

There are currently two ways of setting up a WORKING bond in OpenRC:
for if in eth0 eth1 bond0 ; do ln -s /etc/init.d/net.lo /etc/init.d/net.$if ; done

Then edit in the following in /etc/conf.d/net
rc_need_bond0="net.eth0 net.eth1"
slaves_bond0="eth0 eth1"
config_bond0="dhcp" OR config_bond0="<static IP configuration>"

rm /etc/init.d/net.eth*
ln -s /etc/init.d/net.lod /etc/init.d/net.bond0

Then edit in the following in /etc/conf.d/net
slaves_bond0="eth0 eth1"
config_bond0="dhcp" OR config_bond0="<static IP configuration>"


The both versions will give you the same bond, however version 2 will be faster since the logic for net.eth* is gone, and because of that net.bond0 does not need to push them down reset them before preparing them for the bond.

Either of the two above will give you a working bond, however the instructions in the doc [1] will not.

Comment 1 Xake 2012-01-25 10:56:44 UTC
Also anything leading to a IP-adress on either of the slaves tend to break, with problems like first slave gets an address, second slaves get an address, bond0 does not get anything, and since everything is routed trough bond0 nothing can communicate (since the system wants to use the IP assigned to bond0, not the one assigned to eth0).
Comment 2 Xake 2012-09-05 11:11:12 UTC
Anyone had any time looking at this?

This is actually pretty bad documentation, as also the most common thing to use bonding for, fail-safe, does not work.

If you have rc_need_bond0="net.eth0 net.eth1", then what happens when "net.eth0" fails to start?
Thats right: time to fetch the cart, because you have physically enter the server where "need net" never is satisfied.

So with other words: scrap my possible solution number 1.
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2013-08-03 15:35:01 UTC
If I'm not mistaken, the following should be a more accurate description, not?

3.f. Bonding

For link bonding/trunking emerge net-misc/ifenslave.

Bonding is used to increase network bandwidth. If you have two network cards going to the same network, you can bond them together so your applications see just one interface but they really use both network cards.

First, clear the configuration of the participating interfaces:

Code Listing 6.1: Clearing interface configuration in /etc/conf.d/net

Next, define the bonding between the interfaces:

Code Listing 6.2: Define the bonding
  slaves_bond0="eth0 eth1 eth2"

Remove the net.eth* services from the runlevels, create a net.bond0 one and add that one to the correct runlevel. 
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2013-08-15 08:30:31 UTC
Committed to CVS, should show up on the site in an hour or so.