azarus' page

Alpine Linux WiFi/Ethernet bonding (for Laptops)

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.

Installing required packages

apk add bonding wpa_supplicant

Configuring /etc/network/interfaces

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

Configuring /etc/wpa_supplicant/wpa_supplicant.conf

network={
	ssid="mywifissid"
	key_mgmt=WPA-PSK
	psk="mywifipassword"
}

Configuring wpa_supplicant to start at boot

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