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
and ifenslave
sudo apt install ifupdown ifenslave
Removed netplan:
sudo apt remove netplan.io
Next, I stopped the systemd-networkd
and systemd-networkd.socket
:
systemctl stop systemd-networkd.service
systemctl stop systemd-networkd.socket
systemctl disable systemd-networkd.service
systemctl disable systemd-networkd.socket
Check your /etc/modules
for the following lines:
loop
lp
rtc
bonding
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 ran sudo update-grub
and rebooted for changes to take effect.
GRUB_CMDLINE_LINUX_DEFAULT="nosplash net.ifnames=0 biosdevnames=0"
Then added my interfaces to /etc/network/interfaces
with bonding setup for balance-alb
:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
bond-master bond0
auto eth1
iface eth1 inet manual
bond-master bond0
auto bond0
iface bond0 inet static
address 10.0.0.220
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.1
bond-mode balance-alb
bond-miimon 100
bond-slaves eth0 eth1
I also made it so my resolv.conf
was no longer controlled by stub or anything else.
sudo unlink /etc/resolv.conf
echo "nameserver 10.0.0.1" | sudo tee /etc/resolv.conf
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 the resolv.conf
:
echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.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.
denyinterfaces eth0 eth1
interface bond0
static ip_address=10.0.0.220/24
static routers=10.0.0.1
static domain_name_servers=9.9.9.9 149.112.112.112
Apply those network settings:
sudo /etc/init.d/networking restart
Checked with ifconfig
and checked /proc/net/bonding/bond0
ifconfig
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 10.0.0.220 netmask 255.255.255.0 broadcast 10.0.0.255
ether bc:5f:f4:79:66:fe txqueuelen 1000 (Ethernet)
RX packets 85381 bytes 12752852 (12.7 MB)
RX errors 0 dropped 5 overruns 0 frame 0
TX packets 125655 bytes 156764973 (156.7 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether bc:5f:f4:79:66:fe txqueuelen 1000 (Ethernet)
RX packets 76259 bytes 10724189 (10.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12520 bytes 4905475 (4.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether c8:3a:35:d6:ec:a0 txqueuelen 1000 (Ethernet)
RX packets 9122 bytes 2028663 (2.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 113135 bytes 151859498 (151.8 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 55907 bytes 158911787 (158.9 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 55907 bytes 158911787 (158.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
and
cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: bc:5f:f4:79:66:fe
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: c8:3a:35:d6:ec:a0
Slave queue ID: 0
Best Answer
The exact method to do this is hard, perhaps impossible to locate now in the early days of netplan.
I assume that you mean that your
/etc/default/grub
reads, in part:I also assume that the link you give suggests that you add the referenced wording:
I suggest that you do just that, followed by:
You will also need:
It may already be installed.
Finally, fill in
/etc/network/interfaces
manually to configure your network the way you want it.The exact process to do this post-installation, as far as Google and I can find, doesn't exist. Reboot with your fingers crossed!