My server:
- ASRock B450M/ac (RealTek 8111/8168/8411)
- Ryzen 5 3400G
- 64GB System Memory
- Rosewill RC-411v3 (RealTek 8111/8168/8411)
My Computer:
- Ryzen 7 2700X
- 32GB System Memory
- MSI X470 Gaming Pro Carbon (Intel I211)
I'm attempting to setup network bonding with my server in mode 6 (balance-alb) and I've gotten it to work, for the most part. I'm having an issue where one or both of the network cards will randomly get an IPv4 and/or IPv6 address. I don't think the IPv6 address matters, but when they get an IPv4 address, they break the bond and I lose all connection to the server. My current configuration is as follows;
network:
version: 2
renderer: networkd
ethernets:
enp5s0:
link-local: [ ]
#dhcp4: no
#dhcp6: no
enp4s0:
link-local: [ ]
#dhcp4: no
#dhcp6: no
bonds:
bond0:
addresses: [192.168.0.102/24]
gateway4: 192.168.0.1
nameservers:
addresses: [1.1.1.1, 1.0.0.1]
dhcp6: no
interfaces: [enp5s0, enp4s0]
parameters:
mode: balance-alb
mii-monitor-interval: 1
I have tried both networkd and NetworkManager. I also tried netplan 0.99 and 0.100. Nothing disables local addresses with this configuration even though netplan says it should. How do I disable local addresses on these interfaces?
Edit:
Removed dhcp lines as they don't seem to do anything.
Update on some details for reproducing.
Disabling IPv6 seems to eliminate the issue of IPv4 addresses being added to either of the cards. This fix is broken again if netplan apply
is ran again. However, on occasion neither of the cards will get an IP for a bit of time after running it. This allowed me to run speeds tests and prove this works, though not flawlessly. Rebooting is the best after changing the configuration, however moments after the reboot an IP gets added to one of the cards. Typically 169.254.x.x. This doesn't break everything, but balancing seems to break for the same transfer (upload or download). For example I upload and run a speedtest at the same time (both send data to the server). One of the cards will not receive any data and the other will split the two connections at 500mbit/s each. This does not seem to be an issue when running an upload and a download simultaneously.
Update: Welp, I gave in and reinstalled the operating system. I installed specifically Ubuntu 20.04.1 LTS. Got everything installed and plopped in the configuration for netplan above. It just worked, I didn't even have to enable bonding, it just enabled itself. No IPs have been added to either of the cards since I reinstalled the operating system. Although my issue is resolved, I still don't know what was adding those IPs in the first place. It seems as if another program was retroactively adding IPs. I found another post with someone mentioning this suspicion too.
Please see down at NOTE as extra IPs came back again. So I believe I found what was wrong and how to stop them from getting the extra IPs.
I'm writing this up as an answer because when I tried with netplan I was getting unstable connections with extra IPs appearing on my network cards.
On 20.04 LTS using kernel 5.4.0-54-generic.
Using
ifupdown
and setting the/etc/network/interfaces
file as I dumped netplan all together.Installed
ifupdown
andifenslave
Removed netplan:
Next, I stopped the
systemd-networkd
andsystemd-networkd.socket
:Check your
/etc/modules
for the following lines:I also setup so I am not using predictive naming for my ethernet cards. I have heard from people saying that it can be bad, but it has always worked for me.
Added the following to the
/etc/default/grub
file then ransudo update-grub
and rebooted for changes to take effect.Then added my interfaces to
/etc/network/interfaces
with bonding setup forbalance-alb
:I also made it so my
resolv.conf
was no longer controlled by stub or anything else.You can change your nameserver to whatever your router is or if you want to use 8.8.8.8.
You can add more nameservers with
tee -a
as well to theresolv.conf
:Feb. 25, 2021 Note: I recently had an update to my system and it kicked back on my cards to receiving extra IPs again. To resolve this I had to add
denyinterfaces eth0 eth1
to the/etc/dhcpcd.conf
file. Below is what my/etc/dhcpcd.conf
file looks like. Make changes as needed for your network.Apply those network settings:
Checked with
ifconfig
and checked/proc/net/bonding/bond0
and