Skip to content

Instantly share code, notes, and snippets.

@reitermarkus
Last active May 1, 2021 18:08
Show Gist options
  • Save reitermarkus/ccecbf61f5e9df1fc3920c1eb91f114a to your computer and use it in GitHub Desktop.
Save reitermarkus/ccecbf61f5e9df1fc3920c1eb91f114a to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
sudo apt-get install -y ifenslave
sudo sed -i '/^denyinterfaces eth0 wlan0 bond0$/d' /etc/dhcpcd.conf
cat <<EOS | sudo tee -a /etc/dhcpcd.conf
denyinterfaces eth0 wlan0 bond0
EOS
cat <<EOS | sudo tee /etc/modprobe.d/bonding.conf
options bonding fail_over_mac=none mode=active-backup primary=eth0 primary_reselect=always
EOS
cat <<EOS | sudo tee /etc/network/interfaces.d/bond0
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet manual
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
auto bond0
iface bond0 inet dhcp
bond-slaves eth0 wlan0
bond-primary eth0
bond-mode active-backup
bond-miimon 100
bond-fail_over_mac none
bond-primary_reselect always
bond-updelay 0
bond-downdelay 0
hw-address b8:27:eb:09:93:3b
EOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment