You are not logged in.
Hi,
I'm at home having a configuration which allows me to access network via cable and wireless. Since I do not always have the possibility to access the wired connection, I'd like to configure failover, since I'd like to maximize bandwidth, I'd like to use bonding. These are the same prerequisites as in the wiki entry of "netcfg", in the section "Wired to wireless failover". So I followed this guide. Ok, of course I wouldn't post here, if that would have just worked . Maybe you can help me. Possibly it's just a typo - there are so many files to configure and that happens always to me... .
Ok here is what I did:
1.) I installed those files (contents will be shown at the bottom of this post).
/etc/ifplugd/schoeneborn-bond.action
/etc/modprobe.d/bonding.conf
/etc/netctl/kunterbunt-in-bond
/etc/netctl/schoeneborn-bond
/etc/systemd/schoeneborn-bond.service
(Note that 'kunterbunt-in-bond' configures the wireless connection; I tested It beforehand and it worked)
2.) I enabled them:
netctl enable kunterbunt-in-bond
netctl enable schoeneborn-bond
systemctl enable schoeneborn-bond@bond0.service
3.) I rebooted
This is what happened:
A new network Interface (bond0) for the bond appeared, but no connection was established, even though the cable was plugged in and the wireless network was accessible. At this moment the journal told me:
journalctl -xn:
...
-- All system services necessary queued for starting at boot have been
-- successfully started. Note that this does not mean that the machine is
-- now idle as services might still be busy with completing start-up.
...
I plugged out the cable and put it in again and got the message:
journalctl -xn:
Sep 29 13:34:11 hope kernel: e1000e: enp0s25 NIC Link is Down
Sep 29 13:34:11 hope kernel: bonding: bond0: link status definitely down for interface enp0s25, disabling it
Sep 29 13:34:11 hope kernel: bonding: bond0: now running without any active interface !
Sep 29 13:34:13 hope kernel: e1000e: enp0s25 NIC Link is Up 100 Mbps Full Duplex, Flow Control: Rx/Tx
Sep 29 13:34:13 hope kernel: e1000e 0000:00:19.0 enp0s25: 10/100 speed: disabling TSO
Sep 29 13:34:13 hope kernel: bonding: bond0: link status definitely up for interface enp0s25, 100 Mbps full duplex.
Sep 29 13:34:13 hope kernel: bonding: bond0: making interface enp0s25 the new active one.
Sep 29 13:34:13 hope kernel: bonding: bond0: first active interface up!
Still there was no connection to the internet. At this time the output of 'ip link' was:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s25: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP mode DEFAULT qlen 1000
link/ether 00:24:e8:c0:fc:8f brd ff:ff:ff:ff:ff:ff
3: wlp12s0: <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc mq master bond0 state DOWN mode DEFAULT qlen 1000
link/ether 00:24:e8:c0:fc:8f brd ff:ff:ff:ff:ff:ff
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT
link/ether 00:24:e8:c0:fc:8f brd ff:ff:ff:ff:ff:ff
And this is where I'm stuck. I hope you can give me some suggestions.
The Files:
/etc/ifplugd/schoeneborn-bond.action
#!/bin/sh
case "$2" in
up)
systemctl start "dhcpcd@$1.service" && exit 0
;;
down)
systemctl stop "dhcpcd@$1.service" && exit 0
;;
*)
echo "Wrong arguments" > /dev/stderr
;;
esac
exit 1
/etc/modprobe.d/bonding.conf
options bonding mode=active-backup
options bonding miimon=100
options bonding primary=enp0s25
options bonding max_bonds=0
/etc/netctl/kunterbunt-in-bond
Description='kunterbunt: kabelloses Netzwerk in Schöneborn'
Interface=wlp12s0
Connection=wireless
Security=wpa
IP='no'
ESSID=kunterbunt
Key=...
(When testing the above I had IP=dhcp)
/etc/netctl/schoeneborn-bond
Description='Schoeneborn: wire to wireless fallover and bonding'
Interface='bond0'
Connection=bond
BindsToInterfaces=('enp0s25' 'wlp12s0')
IP='no'
SkipNoCarrier='no'
/etc/systemd/schoeneborn-bond.service
[Unit]
Description=Provides automatic dhcp resolution for bonded failover connection
Requires=netctl@schoeneborn-bond.service
After=netctl@schoeneborn-bond.service
[Service]
ExecStart=/usr/bin/ifplugd -i %i -r /etc/ifplugd/schoeneborn-bond.action -fIns
[Install]
WantedBy=multi-user.target
I hope the structure of this post was not too confusing. I tried my best to make it as clear as possible; but just tell me, if you have any suggestions, how it could be better.
Last edited by Lord Bo (2013-09-29 13:49:33)
Offline
Ethernet bonding was a 2.4 kernel feature. Not sure if they still use it, but it was good for two or more wired connections. You can't bond or bridge a ethernet and wireless connection. About all you can do is have the ethernet or wireless activate if either one stops/unavailable. You can route your wireless connection to a wired connection with iptables, but they just can't be made the same. I haven't gotten it to work, and don't think it was intended to work.
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline
Thanks for the answer. However everything I got above, I just have from the netctl wiki, though I'm just not sure, if I followed the description correctly. The wiki states:
This example describes how to use bonding to fallback to wireless when the wired ethernet goes down. The presence of network connection on each interface is detected and dhcpcd is started when connection on either or both interfaces is established.
I thought, that this means, that wired and wireless are bonded with possible fallback to either connection, if one goes down. Why else would you use bonding? But well, it doesn't work at all. Of course, maybe you are right and the current kernel doesn't support bonding any longer. The section was created by a user named 'Lahwaacz'. I found him in the forums, too. Well, I will just write him an e-mail.
Last edited by Lord Bo (2013-10-03 19:13:10)
Offline
While there are other usecases for bonding as well, your understanding is perfectly correct.
From the output it looks like the dhcp did not start. Did you chmod +x the /etc/ifplugd/schoeneborn-bond.action script?
Offline
Wicd will do that kind of behaviour until it gives up and says it can't find a suitable connection.
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline
The line
Sep 29 13:34:11 hope kernel: bonding: bond0: now running without any active interface !
probably means that the wireless profile was not activated (or it failed). For proper handling of wireless profiles, roaming support is necessary. Enable 'netctl-auto@wlp12s0', that should do it. Additionally, I'd say that the custom ifplugd action is redundant, enabling 'netctl-ifplugd@enp0s25' should be just fine.
Offline
Hi,
thank you all for your kind help. Unfortunatly I can't test it right now. Hopefully I'll get to it the next weekend.
edit: schoeneborn-bond.action is executable . At least, I didn't forget this . But good point: It's often something like that.
Benjamin
Last edited by Lord Bo (2013-10-08 15:32:11)
Offline