Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 400721

Summary: Part about bonding should be reworked
Product: [OLD] Docs on www.gentoo.org Reporter: Xake <kanelxake>
Component: Installation HandbookAssignee: Sven Vermeulen (RETIRED) <swift>
Status: RESOLVED FIXED    
Severity: normal CC: asturm, docs-team
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=3#doc_chap6
Whiteboard:
Package list:
Runtime testing required: ---

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:
1.
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
config_eth0="null"
config_eth1="null"
rc_need_bond0="net.eth0 net.eth1"
slaves_bond0="eth0 eth1"
config_bond0="dhcp" OR config_bond0="<static IP configuration>"


2.
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.

[1] http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=3#doc_chap6
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 169.xxx.xxx.xxx 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
  config_eth0="null"
  config_eth1="null"
  config_eth2="null"

Next, define the bonding between the interfaces:

Code Listing 6.2: Define the bonding
  slaves_bond0="eth0 eth1 eth2"
  config_bond0="192.168.100.4/24"

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.