I have changed quite much since wrote this Howto. So if you made bond with the first version, do
Code: Select all
sudo systemctl disable bond
Also the /usr/local/bin/bond.sh is not needed anymore.
I have lan and wifi in my Niuzu minicomputer. I prefer lan, wifi as a backup net.
active-backup method is to have a redundant net. There are other modes, round-robin uses bonded nics to submit/receive packtets. These are the most used, but there are more, search the net if interested.
EDIT: Found I had not systemd-network running. Easy fix
Code: Select all
sudo systemctl start systemd-networkd
sudo systemctl enable systemd-networkd
sudo systemctl status systemd-networkd
Code: Select all
#/etc/systemd/network/30-bond0.netdev
[NetDev]
Name=bond0
Kind=bond
[Bond]
Mode=active-backup
PrimaryReselectPolicy=always
MIIMonitorSec=1s
Code: Select all
#/etc/systemd/network/30-bond0.network
[Match]
Name=bond0
[Link]
RequiredForOnline=routable
[Network]
BindCarrier=enp2s0 wlan0
DHCP=yes
Code: Select all
#/etc/systemd/network/30-ethernet-bond0.network
[Match]
Name=enp2s0
[Network]
Bond=bond0
PrimarySlave=true
Code: Select all
#/etc/systemd/network/30-wifi-bond0.network
[Match]
Name=wlan0
[Network]
Bond=bond0
Code: Select all
arto@niuzu:~$ networkctl
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 enp2s0 ether routable unmanaged
3 wlan0 wlan enslaved configured
4 bond0 bond routable configured
4 links listed.
arto@niuzu:~$
Code: Select all
#/etc/systemd/network/20-wired.network
[Match]
Name=enp2s0
[Network]
Bond=bond0
[DHCPv4]
RouteMetric=50
[Link]
RequiredForOnline=routable
Code: Select all
#/etc/systemd/network/25-wireless.network
[Match]
Name=wlan0
IgnoreCarrierLoss=10s
[DHCPv4]
RouteMetric=10
[Network]
Bond=bond0
[Link]
RequiredForOnline=routable