# network bonding -when to start ifenslave???

## pjunod

i recently set up ethernet bonding on my computer. I have everything setup and working, but there is still one problem: i get errors every time my computer starts from nfsmount and netmount saying no route to host. I have determined that this is because the ifenslave command "ifenslave bond0 eth0 eth1" is in the local.start script and this is not started until after netmount and nfsmount. Does anyone know what other init script i could put the ifenslave command in so that it loads right after net.bond0 is brought up?

FYI, i can manually run netmount and nfsmount after local has started and they start fine. net.bond0 is set to start on the default runlevel.  I'm getting no errors from anything on startup. I see nothing abnormal in dmesg. Both nics are identical in make/model/rev number(3c905B TX). 

also, i have bonding and my nic modules compiled into the kernel as modules. the options i am passing to the bonding module are "miimon=100 updelay=100 downdelay=100 mode=0"

thanks!

Paul

----------

## n3mo

I use bonding and I've never seen such errors, I used to pass 

```

alias bond0 bonding

options bond0 mode=0 miimon=100

```

 to the module.

Hope this could help you.

----------

## UberLord

Our net scripts support bonding - consult /etc/conf.d/net.example for details.

----------

## pjunod

okay. so i removed the ifenslave entry and setup my /etc/conf.d/net per the example for ethernet bonding. i have

```
slaves_bond0="eth0 eth1"
```

 and 

```
config_bond0=("ip 192.168.0.2 netmask 255.255.255.0")
```

(also tried with broadcast in there too)

and my gateway statement 

```
gateway="bond0/192.168.0.254"
```

.

now when i reboot, it goes to start bond 0 and says 

```
Starting bond0

Adding slaves to bond0 ....              OK

     eth0 eth1 

Bringing up bond0

     ip

     No loaded modules provide "ip" (ip_start)   !!
```

and all services dependant on networking obviously fail after that. 

I read through the posts about similar errors and there seems to be some issues with the newest version of bash. I do not have this version. I had bash 3.0.12 and upgraded to 3.0.14 just to see if that would make any difference. it did not. anybody got any ideas? i do not know if it is a problem using these statements in conf.d/net or what but it works the other way with the exception of the eth cards not being bonded soon enough.

----------

## UberLord

 *pjunod wrote:*   

> 
> 
> ```
> slaves_bond0="eth0 eth1"
> ```
> ...

 

Bad. None of that is documented or you didn't understand it! Here's a config for you

```
slaves_bond0="eth0 eth1"

config_bond0=( "192.168.0.2 netmask 255.255.255.0" )

routes_bond0=( "default via 192.168.0.254" )

```

----------

## double00

i get an odd error message when trying to configure:

```

config_eth0=(

  "192.168.9.4/24 brd 192.168.9.255"

#  "FEC0::9:0003:0004:567:89ab/64"

)

routes_eth0=(

        "default via 192.168.9.250"             # IPv4 default route

)

mtu_eth0="1500"

config_eth2=("null")

config_eth3=("null")

slaves_bond0="eth2 eth3"

config_bond0=("192.168.9.5/24 brd 192.168.9.255")

depend_bond0() {

       need net.eth2 net.eth3

}

   
```

when I start up net.bond0 (/etc/init.d/net.bond0 start) :

```

 * Starting bond0

 *   wpa_supplicant_bond0 does not define a driver

 *   Adding slaves to bond0 ...

 *     eth2 eth3

 *     interface eth2 eth3 does not exist                      

```

why is it looking for eth2 eth3??

have tried lots of syntax variants, can't get it to work. With one eth defined, the script starts ok, but I would like to bond more than one interface  :Wink: 

----------

## UberLord

Try this bonding module

http://dev.gentoo.org/~uberlord/baselayout/bonding

Drop it into /lib/rcscripts/net.modules.d

----------

## thermoman

 *double00 wrote:*   

> i get an odd error message when trying to configure:
> 
> ```
> 
> slaves_bond0="eth2 eth3"
> ...

 

Cause you said so?

----------

## UberLord

 *thermoman wrote:*   

> Cause you said so?

 

Actually he found a bug.

I was trying to be clever and support space seperated strings and arrays - in the lasted ebuild only arrays work and they're not documented!

The above module should fix that ...

----------

## double00

Thanks for the patch  :Smile: 

I won't be able to test for a while, but I'll let you know how I get on.

----------

