Skip to content

Instantly share code, notes, and snippets.

@peter-stratton
Last active November 13, 2018 03:12
Show Gist options
  • Save peter-stratton/4e1f5cd61fa5cec95dc6a2921ad9b6a1 to your computer and use it in GitHub Desktop.
Save peter-stratton/4e1f5cd61fa5cec95dc6a2921ad9b6a1 to your computer and use it in GitHub Desktop.
Connect to same network via ethernet or wifi (in that order) if available.
# /etc/network/interfaces
auto lo
iface lo inet loopback
auto bond0
iface bond0 inet static
address 192.168.1.155
netmask 255.255.255.0
gateway 192.168.1.1
# Bonding
bond-slaves none
bond-primary eth0
bond-mode active-backup
bond-miimon 100
bond-downdelay 200
bond-updelay 200
allow-hotplug wlan0
iface wlan0 inet manual
# Bonding
bond-master bond0
bond-primary eth0
bond-mode active-backup
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug eth0
iface eth0 inet manual
# Bonding
bond-master bond0
bond-primary eth0
bond-mode active-backup
allow-hotplug usb0
iface usb0 inet static
address 192.168.42.42
netmask 255.255.255.0
broadcast 192.168.42.255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment