You are not logged in.

#1 2014-05-21 09:23:55

vri
Member
Registered: 2008-08-17
Posts: 35

[SOLVED] Netctl: not getting wired to wireless failover to work

I followed https://wiki.archlinux.org/index.php/netctl#Bonding to create a wired to wireless failover. It has worked some times, but it fails most of the times, because wlan0 does not get added to the bonding interface.

cat /etc/modprobe.d/bonding.conf
-----------------------------------------------
options bonding mode=active-backup
options bonding miimon=100
options bonding primary=eth0
options bonding max_bonds=0
cat /etc/netctl/bonding 
------------------------------
Description='Bond Interface'
Interface='bond0'
Connection=bond
BindsToInterfaces=(eth0 wlan0)
IP=dhcp
#IP6=stateless
SkipNoCarrier=no
#DHCPClient=dhclient

I have tested the wireless profiles and they are ok. I have my wireless interface configured for Automatic switching of profiles; I have done:

# systemctl enable netctl-auto@wlan0.service

Is it ok to combine this profile switching with bonding??

When it does not work, I get this:

dmesg | grep bond
------------------------------------------------
[    3.488356] systemd[1]: Configuration file /etc/systemd/system/netctl@bonding.service is marked world-inaccessible. This has no effect as configuration data is accessible via APIs without restrictions. Proceeding anyway.
[    4.154459] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[    4.154465] bonding: MII link monitoring set to 100 ms
[    4.395571] bonding: bond0: enslaving eth0 as a backup interface with a down link.
[    4.751184] bonding: wlan0 is up. This may be due to an out of date ifenslave.
[    7.554400] bonding: bond0: link status definitely up for interface eth0, 1000 Mbps full duplex.
[    7.554412] bonding: bond0: making interface eth0 the new active one.
[    7.554842] bonding: bond0: first active interface up!

When it does work, I do not have the line "wlan0 is up..", but instead get "bond0: enslaving wlan0...".

It seems to me that this is related to timing of the startup processes, but I do not know how to debug further.

Any help greatly appreciated.


Theo

Last edited by vri (2014-05-22 13:37:02)

Offline

#2 2014-05-21 11:38:40

andy123
Member
Registered: 2011-11-04
Posts: 169
Website

Re: [SOLVED] Netctl: not getting wired to wireless failover to work

Hey,

I somehow doubt that this will work that way. netctl is kind of hacky and their bonding support was written by some clueless idiot that did minimal testing in a vm and uses only his setup with two normal ethernet cards in roundrobin mode.

The actual source, if you want to take a look.

My guess would be, that your wlan0 card shouldn't have an ip, when netctl tries to enslave it. There should be a way to construct a profile for wifi that does this (only use wpa_supplicant to associate but don't set a ip/use dhcp), but no idea how.

PS: That clueless idiot that wrote netctl's bonding support? Me. big_smile


i'm sorry for my poor english wirting skills…

Offline

#3 2014-05-21 13:03:52

vri
Member
Registered: 2008-08-17
Posts: 35

Re: [SOLVED] Netctl: not getting wired to wireless failover to work

Thanks for your fb, andy123, and for your (maybe hacky) bonding functionality! I would like it if we can make this to work robustly.

I have tested and it appears that the wlan0 does not obtain an ip; that is by stating IP=no in the profile.

If I do not enable netctl-auto, but start it manually, it does seem to work as expected. I am really a noob in this network stuff, but it seems to me like the enslaving of the bonding should take place before netctl-auto fires up the wlan0. Could this be the case? And if so, is there a way to ensure that netctl-auto waits long enough?

Offline

#4 2014-05-21 14:33:13

andy123
Member
Registered: 2011-11-04
Posts: 169
Website

Re: [SOLVED] Netctl: not getting wired to wireless failover to work

Interesting. It might be possible to introducte dependencies by modifying the systemd units netctl generates. Like adding a "After = netctl@bond.service" to the "netctl-auto@wlan0.server" file or something like that.


i'm sorry for my poor english wirting skills…

Offline

#5 2014-05-21 16:39:44

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: [SOLVED] Netctl: not getting wired to wireless failover to work

I thought I remembered something about naming static devices and well...you may want to read this before you continue experimenting with bonding.

Offline

#6 2014-05-22 13:35:49

vri
Member
Registered: 2008-08-17
Posts: 35

Re: [SOLVED] Netctl: not getting wired to wireless failover to work

Thank you MoonSwan for pointing out a potential problem. As per your suggestion, I changed the names to net1 and wifi1 by means of udev rules.

The changed names had no effect on the observed behaviour, the problems remained.

Then I did as suggested by andy123 and changed the systemd unit:

cat /etc/systemd/system/netctl@bonding.service 
-----------------------------------------------------------
.include /usr/lib/systemd/system/netctl@.service

[Unit]
Description=Bond Interface
BindsTo=sys-subsystem-net-devices-net1.device
BindsTo=sys-subsystem-net-devices-wifi1.device
After=sys-subsystem-net-devices-net1.device
After=sys-subsystem-net-devices-wifi1.device
Before=netctl-auto@wifi1.service

Rebooted a couple of times and it is working out fine so far:

dmesg | grep wifi1
-------------------------------------------------------
[    3.814375] systemd[1]: Expecting device sys-subsystem-net-devices-wifi1.device...
[    4.389597] systemd-udevd[184]: renamed network interface wlan0 to wifi1
[    5.111894] IPv6: ADDRCONF(NETDEV_UP): wifi1: link is not ready
[    5.112066] bonding: bond0: enslaving wifi1 as a backup interface with a down link.
[   15.553835] wifi1: authenticate with 00:26:cb:42:0e:10
[   15.557109] wifi1: send auth to 00:26:cb:42:0e:10 (try 1/3)
[   15.558550] wifi1: authenticated
[   15.559165] wifi1: associate with 00:26:cb:42:0e:10 (try 1/3)
[   15.565592] wifi1: RX AssocResp from 00:26:cb:42:0e:10 (capab=0x431 status=0 aid=60)
[   15.590470] wifi1: associated
[   15.612589] bonding: bond0: link status definitely up for interface wifi1, 0 Mbps full duplex.

So marking this thread as solved, thanks for helping me out!
andy123, will you follow up on this or do you want me to file a bug report or so?

Offline

#7 2014-05-22 14:48:34

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,804

Re: [SOLVED] Netctl: not getting wired to wireless failover to work

andy123 wrote:

Hey,

I somehow doubt that this will work that way. netctl is kind of hacky and their bonding support was written by some ...
PS: That clueless idiot that wrote netctl's bonding support? Me. big_smile

Facepalm hmm
I was about to chastise you about being nice to developers..... Then I finished reading the whole post smile
Thank you for your contributions.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#8 2014-05-22 19:04:37

andy123
Member
Registered: 2011-11-04
Posts: 169
Website

Re: [SOLVED] Netctl: not getting wired to wireless failover to work

vri wrote:

Thank you MoonSwan for pointing out a potential problem. As per your suggestion, I changed the names to net1 and wifi1 by means of udev rules.

The changed names had no effect on the observed behaviour, the problems remained.

Then I did as suggested by andy123 and changed the systemd unit:

cat /etc/systemd/system/netctl@bonding.service 
-----------------------------------------------------------
.include /usr/lib/systemd/system/netctl@.service

[Unit]
Description=Bond Interface
BindsTo=sys-subsystem-net-devices-net1.device
BindsTo=sys-subsystem-net-devices-wifi1.device
After=sys-subsystem-net-devices-net1.device
After=sys-subsystem-net-devices-wifi1.device
Before=netctl-auto@wifi1.service

Rebooted a couple of times and it is working out fine so far:

dmesg | grep wifi1
-------------------------------------------------------
[    3.814375] systemd[1]: Expecting device sys-subsystem-net-devices-wifi1.device...
[    4.389597] systemd-udevd[184]: renamed network interface wlan0 to wifi1
[    5.111894] IPv6: ADDRCONF(NETDEV_UP): wifi1: link is not ready
[    5.112066] bonding: bond0: enslaving wifi1 as a backup interface with a down link.
[   15.553835] wifi1: authenticate with 00:26:cb:42:0e:10
[   15.557109] wifi1: send auth to 00:26:cb:42:0e:10 (try 1/3)
[   15.558550] wifi1: authenticated
[   15.559165] wifi1: associate with 00:26:cb:42:0e:10 (try 1/3)
[   15.565592] wifi1: RX AssocResp from 00:26:cb:42:0e:10 (capab=0x431 status=0 aid=60)
[   15.590470] wifi1: associated
[   15.612589] bonding: bond0: link status definitely up for interface wifi1, 0 Mbps full duplex.

So marking this thread as solved, thanks for helping me out!
andy123, will you follow up on this or do you want me to file a bug report or so?

Hm… That's probably up for the netctl maintainer to decide if this should be part of netctl's funtionality. I don't know how a solution to your problem would be properly implemented. It sounds like netctl would need to provide some sort interface dependencies, maybe it already does?

If you want to file a bug report, you can do that on github, or the mailinglist (arch-projects).


i'm sorry for my poor english wirting skills…

Offline

Board footer

Powered by FluxBB