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

Javier je-vv at e.email
Mon Apr 13 05:57:57 CEST 2020


On 3/31/20 8:48 PM, Javier via artix-general wrote:
> On 3/30/20 7:21 AM, Dudemanguy via artix-general wrote:
>>> @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.
>>
>> No special tricks here. I only use the wpa_supplicant daemon in s6 (no hooks or anything). The wpa_supplicant script has dhcpcd as a dependency so that one is always started as well. It seems to "just work" for me. If I plug in ethernet, that is preferred. If I leave it wireless, then it falls back on the wireless connection.
> 
> I just tried on the box where I installed artix-s6, and I got exactly the same behavior as on arch, :(  When enabling/starting only wpa_supplicant (which on wpa_supplicant-s6 depends on dhcpcd daemon), I then get both the wired and the wireless interfaces up, and both with dhcp lease and running...
> 

@dudemanguy, I believe I got what you meant.  Both interfaces actually get lease, and up and running.  Just that the routing metric for wired interfaces is lower by default than the wireless ones.  By re-reading the dhcpcd man:

>     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 met‐
>     ric, otherwise dhcpcd changes the routes to use the interface with the same route and the lowest metric.
> ...
>     -m, --metric metric
>             Metrics are used to prefer an interface over another one, lowest wins.  dhcpcd will supply a default metic of 200 + if_nametoindex(3).  An extra 100
>             will be added for wireless interfaces.

Then even if I get:

> % ip address show                                                                                                                                                        
> ...
> 2: lm-0-intel-wd: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
> ...
>     inet 192.168.0.12/24 brd 192.168.0.255 scope global dynamic noprefixroute lm-0-intel-wd
> ...
> 4: lm-0-rtlwifi-wl: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
> ...
>     inet 192.168.0.80/24 brd 192.168.0.255 scope global dynamic noprefixroute lm-0-rtlwifi-wl
> ...

Both connected to the same net, as:

> % route -n                                                                                                                                                               
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> 0.0.0.0         192.168.0.1     0.0.0.0         UG    202    0        0 lm-0-intel-wd
> 0.0.0.0         192.168.0.1     0.0.0.0         UG    304    0        0 lm-0-rtlwifi-wl
> 192.168.0.0     0.0.0.0         255.255.255.0   U     202    0        0 lm-0-intel-wd
> 192.168.0.0     0.0.0.0         255.255.255.0   U     304    0        0 lm-0-rtlwifi-wl

Then traffic will always prefer flowing through lm-0-intel-wd, than through lm-0-rtlwifi-wl, unless of course lm-0-intel-wd connection becomes unavailable...

Is that what you meant @dudemanguy, by working out of the box?  In my mind I was expecting (never achieving it with netcfg neither netctl on arch though) getting only "lm-0-intel-wd" with lease and up and running, and only if its connection became unavailable, then look for a dhcp lease for lm-0-rtlwifi-wl...  I guess I was naive, and misunderstanding that things just work out of the box, thanks to linux supporting route metrics, and the way dhcpcd assigns metrics by default (one could set different values).

Thanks a lot !

-- 
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/20200412/b6736c0c/attachment.sig>


More information about the artix-general mailing list