[arch-general] systemd-networkd and netctl with multiple interfaces

Leonid 'Beef Marsala' Isaev leonid.isaev at jila.colorado.edu
Fri Nov 13 03:31:28 UTC 2015


On Thu, Nov 12, 2015 at 07:52:20PM +0100, Bennett Piater wrote:
> 
> I mostly just use LAN when I need to download a lot of stuff at home,
> because WIFI is much slower even at 54 Mb/s, especially since my home
> network is 1 Gbps. So I could just turn WIFI off in those cases, that
> would be an acceptable situation.

You probably don't want to turn off the wifi physically because you will also
need to tell daemons like wpa_supplicant to quit gracefully (and then restart
when the card is turned back on).
 
> However, I want to understand all of this as fully as possible.
> So, yes, I would appreciate your profiles - but please take your time
> digging them out :)

I'd say, the cleanest option is to keep wlan0 interface up and have
wpa_supplicant running on it all the time, but configure it a slave to ethernet
in the bonding. So, whenever you plug a cable, the kernel will automatically
send all traffic through eth. Unplug it, and the traffic will flow over wifi.
And your applications shouldn't even notice that.

The setup is simple: create a netctl profile, like
$ cat bonding0 
Description="Bond interface for external NICs"

Interface=bond0
Connection=bond
BindsToInterfaces=(eth0 wlan0)

IP=no

Then, enable wpa_supplicant-nl80211 at wlan0.service after
netctl at bonding0.service, and finally configure IP, firewall, etc using the new
bond0 interface. This IP (and routing) will stay stable in between switches
between wired and wireless networks. The above ordering of netctl and
wpa_supplicant is the only trick here...

HTH,
-- 
Leonid Isaev
GPG fingerprints: DA92 034D B4A8 EC51 7EA6  20DF 9291 EE8A 043C B8C4
                  C0DF 20D0 C075 C3F1 E1BE  775A A7AE F6CB 164B 5A6D


More information about the arch-general mailing list