Date: 2020-05-10
This page documents how I pair my WiFi and Ethernet interfaces together so that maintaining network connectivity is entirely automated, even when I dock/undock my laptop.
apk add bonding wpa_supplicant
auto lo iface lo inet loopback auto bond0 iface bond0 inet dhcp bond-slaves eth0 wlan0 bond-mode active-backup bond-miimon 100 bond-primary eth0
network={ ssid="mywifissid" key_mgmt=WPA-PSK psk="mywifipassword" }
rc-update add wpa_supplicant boot
This network setup automatically uses eth0 when available, and if not, uses WiFi. It also works seamlessly with wireguard VPNs.
//TODO: document this in the Alpine Linux wiki