# ethernet bonding and wpa_supplicant not working =/

## thomasa88

Hi, I'm trying to set up bonding with my wired and wireless interface to be able to move around with my laptop and plug it in for better speed, without losing any connections.

The problem is that the bonding together with wpa_supplicant seems to go crazy and eth1 is brought up and down all the time =(

```

Dec 27 22:21:50 barbara Ethernet Channel Bonding Driver: v3.1.3 (June 13, 2007)

Dec 27 22:21:50 barbara bonding: MII link monitoring set to 100 ms

Dec 27 22:21:50 barbara Device driver bond0 lacks bus and class support for being resumed.

Dec 27 22:21:51 barbara ADDRCONF(NETDEV_UP): eth1: link is not ready

Dec 27 22:21:52 barbara ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready

Dec 27 22:21:52 barbara wpa_cli: interface eth1 CONNECTED

Dec 27 22:21:53 barbara ADDRCONF(NETDEV_UP): bond0: link is not ready

Dec 27 22:21:53 barbara ADDRCONF(NETDEV_UP): eth0: link is not ready

Dec 27 22:21:53 barbara ADDRCONF(NETDEV_UP): eth0: link is not ready

Dec 27 22:21:53 barbara bonding: bond0: enslaving eth0 as an active interface with a down link.

Dec 27 22:21:53 barbara eth1: Setting MAC to 00:11:43:69:c8:b8

Dec 27 22:21:53 barbara ADDRCONF(NETDEV_UP): eth1: link is not ready

Dec 27 22:21:53 barbara bonding: bond0: enslaving eth1 as an active interface with a down link.

Dec 27 22:21:53 barbara dhcpcd[6216]: bond0: dhcpcd 3.1.6 starting

Dec 27 22:21:53 barbara dhcpcd[6216]: bond0: hardware address = 00:11:43:69:c8:b8

Dec 27 22:21:53 barbara dhcpcd[6216]: bond0: DUID = 00:01:00:01:0e:b0:c9:f7:00:0e:35:f9:7d:30

Dec 27 22:21:53 barbara dhcpcd[6216]: bond0: broadcasting for a lease

Dec 27 22:21:53 barbara wpa_cli: interface eth1 DISCONNECTED

Dec 27 22:21:53 barbara rc-scripts: ERROR:  cannot stop net.eth1 as net.bond0 is still up.

Dec 27 22:21:53 barbara wpa_cli: executing '/etc/init.d/net.eth1 --quiet stop' failed

Dec 27 22:21:55 barbara ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready

Dec 27 22:21:55 barbara bonding: bond0: link status definitely up for interface eth1.

Dec 27 22:21:55 barbara ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready

Dec 27 22:21:56 barbara b44: eth0: Link is up at 100 Mbps, full duplex.

Dec 27 22:21:56 barbara b44: eth0: Flow control is off for TX and off for RX.

Dec 27 22:21:56 barbara ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

Dec 27 22:21:56 barbara bonding: bond0: link status definitely up for interface eth0.

Dec 27 22:21:59 barbara bonding: bond0: link status definitely down for interface eth1, disabling it

Dec 27 22:21:59 barbara bonding: bond0: link status definitely up for interface eth1.

Dec 27 22:22:00 barbara dhcpcd[6216]: bond0: offered 192.168.66.104 from 192.168.66.1

Dec 27 22:22:00 barbara dhcpcd[6216]: bond0: checking 192.168.66.104 is available on attached networks

Dec 27 22:22:02 barbara dhcpcd[6216]: bond0: leased 192.168.66.104 for 43200 seconds

Dec 27 22:22:02 barbara dhcpcd[6216]: bond0: adding IP address 192.168.66.104/24

Dec 27 22:22:02 barbara dhcpcd[6216]: bond0: adding default route via 192.168.66.1 metric 0

Dec 27 22:22:02 barbara dhcpcd[6216]: bond0: exiting

Dec 27 22:22:03 barbara bonding: bond0: link status definitely down for interface eth1, disabling it

Dec 27 22:22:04 barbara bonding: bond0: link status definitely up for interface eth1.

Dec 27 22:22:06 barbara bond0: no IPv6 routers present

Dec 27 22:22:06 barbara eth1: no IPv6 routers present

Dec 27 22:22:06 barbara eth0: no IPv6 routers present

Dec 27 22:22:08 barbara bonding: bond0: link status definitely down for interface eth1, disabling it

Dec 27 22:22:08 barbara bonding: bond0: link status definitely up for interface eth1.

Dec 27 22:22:12 barbara bonding: bond0: link status definitely down for interface eth1, disabling it

Dec 27 22:22:12 barbara bonding: bond0: link status definitely up for interface eth1.

Dec 27 22:22:16 barbara bonding: bond0: link status definitely down for interface eth1, disabling it

Dec 27 22:22:17 barbara bonding: bond0: link status definitely up for interface eth1.

```

Has anyone succeeded with bonding using wpa_supplicant?

----------

## mimosinnet

 *thomasa88 wrote:*   

> The problem is that the bonding together with wpa_supplicant seems to go crazy and eth1 is brought up and down all the time

 

Have you been successful in using bonding with wpa_supplicant? I am about to start trying it. 

Cheers!

----------

## thomasa88

 *mimosinnet wrote:*   

> 
> 
> Have you been successful in using bonding with wpa_supplicant? I am about to start trying it. 
> 
> Cheers!

 

I stopped trying after a while since I couldn't get past this problem  :Sad: 

But do let me know if you succeed.

----------

## mimosinnet

Thanks for the reply. Apparently, I am able to get the interfaces bonded. Dmesg gives me some odd messages:

```
BUG: scheduling while atomic: ifenslave/12232/0x00000100

Pid: 12232, comm: ifenslave Tainted: P         2.6.25-gentoo-r7 #3

 [<c0451abd>] schedule+0x78/0x5a1

 [<c012588f>] __mod_timer+0x8d/0x97

 [<c04522ba>] schedule_timeout+0x6b/0x86

 [<c01254ca>] process_timeout+0x0/0x5

 [<c01258a6>] msleep+0xd/0x12

 [<c02eca35>] __mdio_cmd+0x14/0x38

 [<c02eca6e>] mdio_read+0x15/0x1d

 [<c02edf8e>] mii_ethtool_gset+0xb2/0x1c8

 [<f8891063>] bond_update_speed_duplex+0x26/0x65 [bonding]

 [<c0130890>] notifier_call_chain+0x2a/0x52

 [<f8891af5>] bond_compute_features+0x45/0x84 [bonding]

 [<f8893b0b>] bond_enslave+0x586/0x854 [bonding]

 [<c03a382f>] skb_segment+0x60/0x395

 [<f8894e4f>] bond_do_ioctl+0x264/0x39e [bonding]

 [<c03a6136>] __dev_get_by_name+0x68/0x73

 [<f8894beb>] bond_do_ioctl+0x0/0x39e [bonding]

 [<c03a7ddd>] dev_ifsioc+0x25d/0x277

 [<c03a82cf>] dev_ioctl+0x4d8/0x571

 [<c039d598>] sock_ioctl+0x1a8/0x1ca

 [<c039d3f0>] sock_ioctl+0x0/0x1ca

 [<c016b350>] vfs_ioctl+0x1c/0x5d

 [<c016b5bf>] do_vfs_ioctl+0x22e/0x241

 [<c016b613>] sys_ioctl+0x41/0x5a

 [<c0103a72>] sysenter_past_esp+0x5f/0x85

 [<c0450000>] migration_call+0x9e/0x3a5

 =======================

bonding: bond0: making interface eth0 the new active one.

bonding: bond0: first active interface up!

bonding: bond0: enslaving eth0 as an active interface with an up link.

bonding: bond0: enslaving ath0 as a backup interface with a down link.

bonding: bond0: link status definitely up for interface ath0.

eth0: mii ext = 0000.

eth0: mii lpa = 45e1 adv = 01e1.

eth0: link on 100 Mbps Full Duplex mode.
```

Nevertheless, after a short time, ifconfig show the wireles interface (ath0) with an IP outside the network:

```
# ifconfig

ath0      Link encap:Ethernet  HWaddr 00:A0:D1:CB:2F:38

          inet addr:169.254.120.159  Bcast:169.254.255.255  Mask:255.255.0.0

          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1

          RX packets:214 errors:0 dropped:0 overruns:0 frame:0

          TX packets:483 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:55132 (53.8 Kb)  TX bytes:106696 (104.1 Kb)

bond0     Link encap:Ethernet  HWaddr 00:A0:D1:CB:2F:38

          inet addr:192.168.1.110  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1

          RX packets:14666 errors:0 dropped:0 overruns:0 frame:0

          TX packets:14634 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:13487422 (12.8 Mb)  TX bytes:2019763 (1.9 Mb)

eth0      Link encap:Ethernet  HWaddr 00:A0:D1:CB:2F:38

          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1

          RX packets:14452 errors:0 dropped:0 overruns:0 frame:0

          TX packets:14151 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:13432290 (12.8 Mb)  TX bytes:1913067 (1.8 Mb)

          Interrupt:19 Base address:0xdead
```

These are the steps I am following:

1.- Setting eth0 and ath0 down.

2.- Giving an ip to bond0

3.- ifenslave bond0 eth0 ath0

I will continue trying. 

Cheers!

----------

## mimosinnet

It looks like it is working. This is what I get from dmesg (I have selected relevant parts):

```
bonding: bond0: Warning: failed to get speed and duplex from ath0, assumed to be 100Mb/sec and Full.

bonding: bond0: making interface ath0 the new active one.

bonding: bond0: first active interface up!

bonding: bond0: enslaving ath0 as an active interface with an up link.

BUG: scheduling while atomic: ifenslave/3296/0x00000100

Pid: 3296, comm: ifenslave Tainted: P         2.6.25-gentoo-r7 #3

 [<c0451abd>] schedule+0x78/0x5a1

 [<c012588f>] __mod_timer+0x8d/0x97

 [<c04522ba>] schedule_timeout+0x6b/0x86

 [<c01254ca>] process_timeout+0x0/0x5

 [<c01258a6>] msleep+0xd/0x12

 [<c02eca35>] __mdio_cmd+0x14/0x38

 [<c02eca6e>] mdio_read+0x15/0x1d

[...]

BUG: scheduling while atomic: ifenslave/3296/0x00000100

Pid: 3296, comm: ifenslave Tainted: P         2.6.25-gentoo-r7 #3

 [<c0451abd>] schedule+0x78/0x5a1

[...]

 =======================

BUG: scheduling while atomic: ifenslave/3296/0x00000100

Pid: 3296, comm: ifenslave Tainted: P         2.6.25-gentoo-r7 #3

 [<c0451abd>] schedule+0x78/0x5a1

 [<c012588f>] __mod_timer+0x8d/0x97

[...]

 =======================

bonding: bond0: enslaving eth0 as a backup interface with a down link.

eth0: mii ext = 0000.

eth0: mii lpa = 45e1 adv = 01e1.

eth0: link on 100 Mbps Full Duplex mode.

bonding: bond0: link status definitely up for interface eth0.
```

My two interfaces depend on bond0:

 # ifconfig

```
ath0      Link encap:Ethernet  HWaddr 00:16:44:1B:0C:4A  

          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1

          RX packets:838 errors:0 dropped:0 overruns:0 frame:0

          TX packets:484 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:308066 (300.8 Kb)  TX bytes:53982 (52.7 Kb)

bond0     Link encap:Ethernet  HWaddr 00:16:44:1B:0C:4A  

          inet addr:192.168.1.110  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1

          RX packets:884 errors:0 dropped:0 overruns:0 frame:0

          TX packets:484 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:318776 (311.3 Kb)  TX bytes:53982 (52.7 Kb)

eth0      Link encap:Ethernet  HWaddr 00:16:44:1B:0C:4A  

          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1

          RX packets:46 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:10710 (10.4 Kb)  TX bytes:0 (0.0 b)

          Interrupt:19 Base address:0xdead
```

This is what I have in rc.conf:

```
rc_plug_services="!net.*"
```

This is my /etc/conf.d/net:

```
config_eth0="arping"

#arping_sleep=2

#arping_sleep_lan=5

#arping_wait=5

#arping_wait_lan=5

# En cas de que el gateway sigui 192.168.1.1 (casa) li donem 192.168.1.105

gateways_eth0="192.168.1.1 158.109.128.1"

config_192168001001="192.168.1.105/24"

routes_192168001001="default via 192.168.1.1"

config_158109128001="158.109.132.39/24"

routes_158109128001="default via 158.109.128.1"

fallback_eth0="dhcp"

# ath0

modules_ath0="wpa_supplicant"

wpa_supplicant_ath0="-Dmadwifi -c /etc/wpa_supplicant/wpa_supplicant.conf"

wpa_timeout_ath0=60

#config_ath0="null"

config_ath0="dhcp"

#config_eth0="null"

slaves_bond0="ath0 eth0"

depend_bond0() {

  after net.eth0 net.ath0

}

config_bond0="192.168.1.110/24"

routes_bond0="default via 192.168.1.1"

fallback_bond0="dhcp"
```

Cheers!

----------

## mimosinnet

I start to have some issues with bonding the wired and the wireless interface. Despite I get a bonded interface, I can only get the bonfrf interface connecting to internet if ath0 (wireless) is the active one in the active-backup mode. I am also getting this message in dmesg:

```
bonding: bond0: Warning: failed to get speed and duplex from ath0, assumed to be 100Mb/sec and Full.
```

My card is a:

```
# lspci

02:00.0 Ethernet controller: Atheros Communications, Inc. AR5006EG 802.11 b/g Wireless PCI Express Adapter (rev 01)
```

And this is the bonding mode I am using:

 *Quote:*   

> 	active-backup or 1
> 
> 		Active-backup policy: Only one slave in the bond is
> 
> 		active.  A different slave becomes active if, and only
> ...

 

Cheers!

----------

