You are not logged in.

#1 2018-03-18 19:07:43

LaserEyess
Member
Registered: 2015-05-06
Posts: 12

netctl-auto functionality with wired/wireless failover

I'm not sure if this is possible, but if it is I cannot get it to work. Based on this post it seems like someone has gotten it to work before, but this configuration did not work for me. I get the following error:

● netctl-auto@wlp3s0.service - Automatic wireless network connection using netctl profiles
   Loaded: loaded (/usr/lib/systemd/system/netctl-auto@.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2018-03-18 14:31:47 EDT; 52s ago
     Docs: man:netctl.special(7)
  Process: 431 ExecStopPost=/usr/bin/netctl-auto clean wlp3s0 (code=exited, status=0/SUCCESS)
  Process: 429 ExecStart=/usr/bin/netctl-auto start wlp3s0 (code=exited, status=1/FAILURE)

Mar 18 14:31:47 homura systemd[1]: Starting Automatic wireless network connection using netctl profiles...
Mar 18 14:31:47 homura netctl-auto[429]: The interface 'wlp3s0' is already up
Mar 18 14:31:47 homura systemd[1]: netctl-auto@wlp3s0.service: Control process exited, code=exited status=1
Mar 18 14:31:47 homura systemd[1]: netctl-auto@wlp3s0.service: Failed with result 'exit-code'.
Mar 18 14:31:47 homura systemd[1]: Failed to start Automatic wireless network connection using netctl profiles.

Now, this makes sense to me because it was explicitly mentioned in the wiki that you cannot have any other service files for networking active when using netctl-auto@, as it will take care of everything. clearly there's a conflict with netctl@failover.service, which, for reference is the following:

.include /usr/lib/systemd/system/netctl@.service

[Unit]
Description=A wired connection with failover to wireless
BindsTo=sys-subsystem-net-devices-enp0s31f6.device
BindsTo=sys-subsystem-net-devices-wlp3s0.device
After=sys-subsystem-net-devices-enp0s31f6.device
After=sys-subsystem-net-devices-wlp3s0.device
Before=netctl-auto@wlp3s0.service

So, my next thought is to do it manually. Let the bonded interface come up, then disable wlp3s0, and start netctl-auto manually. This works, however, wlp3s0 gets its own IP address and completely ignores the bonded interface. Unfortunately I didn't screencap the output of ip addr, but bond0 was 'up', however it had no IP address. I did get the output in the journal though

-- Logs begin at Sat 2018-03-17 14:26:34 EDT, end at Sun 2018-03-18 14:33:52 EDT. --
Mar 18 14:31:47 homura systemd[1]: Created slice system-netctl\x2dauto.slice.
Mar 18 14:31:47 homura systemd[1]: Starting Automatic wireless network connection using netctl profiles...
Mar 18 14:31:47 homura netctl-auto[429]: The interface 'wlp3s0' is already up
Mar 18 14:31:47 homura systemd[1]: netctl-auto@wlp3s0.service: Control process exited, code=exited status=1
Mar 18 14:31:47 homura systemd[1]: netctl-auto@wlp3s0.service: Failed with result 'exit-code'.
Mar 18 14:31:47 homura systemd[1]: Failed to start Automatic wireless network connection using netctl profiles.
Mar 18 14:31:47 homura sudo[426]: pam_unix(sudo:session): session closed for user root
Mar 18 14:32:49 homura sudo[450]:     user : TTY=tty1 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/ip link set dev wlp3s0 down
Mar 18 14:32:49 homura sudo[450]: pam_unix(sudo:session): session opened for user root by user(uid=0)
Mar 18 14:32:50 homura sudo[450]: pam_unix(sudo:session): session closed for user root
Mar 18 14:33:38 homura sudo[455]:     user : TTY=tty1 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/systemctl start netctl-auto@wlp3s0.service
Mar 18 14:33:38 homura sudo[455]: pam_unix(sudo:session): session opened for user root by user(uid=0)
Mar 18 14:33:38 homura systemd[1]: Starting Automatic wireless network connection using netctl profiles...
Mar 18 14:33:38 homura netctl-auto[458]: Included profile 'Basement2'
Mar 18 14:33:38 homura wpa_actiond[475]: Starting wpa_actiond session for interface 'wlp3s0'
Mar 18 14:33:38 homura systemd[1]: Started Automatic wireless network connection using netctl profiles.
Mar 18 14:33:38 homura sudo[455]: pam_unix(sudo:session): session closed for user root
Mar 18 14:33:42 homura kernel: wlp3s0: authenticate with 60:e3:27:8a:f4:49
Mar 18 14:33:42 homura kernel: wlp3s0: send auth to 60:e3:27:8a:f4:49 (try 1/3)
Mar 18 14:33:42 homura kernel: wlp3s0: authenticated
Mar 18 14:33:42 homura kernel: wlp3s0: associate with 60:e3:27:8a:f4:49 (try 1/3)
Mar 18 14:33:42 homura kernel: wlp3s0: RX AssocResp from 60:e3:27:8a:f4:49 (capab=0x1431 status=0 aid=3)
Mar 18 14:33:42 homura kernel: wlp3s0: associated
Mar 18 14:33:42 homura wpa_actiond[475]: Interface 'wlp3s0' connected to network 'Basement2'
Mar 18 14:33:42 homura dhcpcd[495]: DUID 00:01:00:01:22:40:1c:47:f8:59:71:1c:59:df
Mar 18 14:33:42 homura dhcpcd[495]: wlp3s0: IAID ad:0a:b1:cc
Mar 18 14:33:42 homura kernel: bond0: link status definitely up for interface wlp3s0, 0 Mbps full duplex
Mar 18 14:33:42 homura kernel: bond0: making interface wlp3s0 the new active one
Mar 18 14:33:42 homura kernel: bond0: first active interface up!
Mar 18 14:33:42 homura kernel: IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
Mar 18 14:33:42 homura dhcpcd[495]: wlp3s0: rebinding lease of 10.0.1.87
Mar 18 14:33:46 homura dhcpcd[495]: wlp3s0: NAK: requested address not available from 10.0.1.1
Mar 18 14:33:46 homura dhcpcd[495]: wlp3s0: message: requested address not available
Mar 18 14:33:46 homura dhcpcd[495]: wlp3s0: soliciting a DHCP lease
Mar 18 14:33:47 homura dhcpcd[495]: wlp3s0: offered 10.0.1.86 from 10.0.1.1
Mar 18 14:33:47 homura dhcpcd[495]: wlp3s0: probing address 10.0.1.86/24
Mar 18 14:33:52 homura dhcpcd[495]: wlp3s0: leased 10.0.1.86 for 7200 seconds
Mar 18 14:33:52 homura dhcpcd[495]: wlp3s0: adding route to 10.0.1.0/24
Mar 18 14:33:52 homura dhcpcd[495]: wlp3s0: adding default route via 10.0.1.1
Mar 18 14:33:52 homura dhcpcd[495]: forked to background, child pid 544

And all this time the bond is still working:

-- Logs begin at Sat 2018-03-17 14:26:34 EDT, end at Sun 2018-03-18 14:35:44 EDT. --
Mar 18 14:35:44 homura kernel: e1000e: enp0s31f6 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx
Mar 18 14:35:44 homura kernel: bond0: link status definitely up for interface enp0s31f6, 1000 Mbps full duplex
Mar 18 14:35:44 homura kernel: bond0: making interface enp0s31f6 the new active one

Here is the failover profile:

Description='A wired connection with failover to wireless'
Interface=bond0
Connection=bond
BindsToInterfaces=(enp0s31f6 wlp3s0)
IP=dhcp

TL;DR, clearly I'm doing something wrong. Or this is just not possible. To clarify precisely what I want

  • wireless/wired failover where I use bond0 as the interface

  • Automatic switching of wireless profiles when one comes in/out of range

  • All of this happening WITHOUT applications being aware of it (so I don't have to restart ssh for example)

  • Ideally using the tools I already have (netctl, wpa_supplicant)

Any information on more debugging I could do would be appreciated, or if some additional logs/configs are needed I can provide them. Testing this is hard though because it requires a lot of reboots and my network getting messed up constantly.

Additinally, what I'm using right now, netctl-ifplugd+netctl-auto, works flawless for what those two services are designed to do. Therefore, I do not believe I have any issues with my ethernet or wireless networking. However, this set up does not fit bullet points 1 and 3 in my list above. I have to renegociate an IP address and it kills any open connections. But that seems to be by design since it's not a failover.

Offline

Board footer

Powered by FluxBB