[artix-general] dhcpcd (daemon) + wpa_supplicant (daemon), with wireless bieng a failover support for wired

Javier je-vv at e.email
Mon Mar 30 05:03:28 CEST 2020


On 3/29/20 12:14 AM, Javier via artix-general wrote:
> On 3/24/20 8:47 AM, Dudemanguy via artix-general wrote:
>>> Has someone successfully made use of dhcpcd + wpa_supplicant in a way only one of them is up, and preferably the wired one?
>>
>> I think this already works. I use the wpa_supplicant service on my laptop (specifying the wireless interface in /etc/s6/sv/wpa_supplicant-srv/conf). If I plug in an ethernet cable, it appears to prefer the wired interface (just checking the IP on the internet), and if I unplug it, it falls back to the wireless connection.
> 
> Hi !
> 
> How can this be achieved?
> 
> I imagine it can be like:
> 
> 1.-  Start and enable the dhcpcd daemon.  No special configuration required (default one seems fine).
> 2.-  Start and enable the wpa_supplicant daemon, having configured the wireless interface on /etc/s6/wpa_supplicant_srv/conf, and having configured /etc/wpa_supplicant/wpa_supplicant.conf previously.
> 
> I read the "multiple interfaces" section of the dhcpcd man, and I wouldn't have guessed the failover mechanism from there:  "Interfaces are preferred by carrier, DHCP lease/IPv4LL and then lowest metric.  For systems that support route metrics, each route will be tagged with the metric, otherwise dhcpcd changes the routes to use the interface with the same route and the lowest metric".
> 
> But if that's all required, then that's fantastic, :)  If only I have known before, I wouldn't have used netcfg at its time, neither its successor later on, :)
> 
> Thanks !


BTW, I tried on a laptop with arch, modifying the dhcpcd service to include "-M" (dhcpcd master mode used on the S6 daemon).  I couldn't get the failover effect, :(

I tried 1st without starting/enabling the wpa_supplicant service for the wireless interface, but using the wpa_supplicant hook.  As advertised, dhcpcd daemon brought all interfaces up, so I ended up with the wired and the wireless connections, both up and with IP provided by the dhcp server, so that was not good at all...

I then disabled the dhcpcd hook, and tried the wpa_supplicant daemon for the specific wireless interface, and once it started, it brought the wireless interface up, regardless the wired one was already up.  So not good either.

@dudemanguy, what special tweaks did you do to get the failover effect with those 2 daemons only?  I just modified the arch services to behave like the S6 ones, and I wasn't even close to get the failover effect...  And as mentioned, I also tried bonding in failover mode with really awful results before, so I sort of discarded that path, but perhaps that's what you do?  Any ways, I just failed with just the 2 daemons alone on an arch laptop.  For sure I'm missing something.

Thanks !


-- 
Javier

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <https://lists.artixlinux.org/archives/artix-general/attachments/20200329/6edd5d2a/attachment-0001.sig>


More information about the artix-general mailing list