I have a Linux machine Ubuntu 22.04 with two interfaces that I called bond0
and bond1
. This machine has IP 10.242.87.123
and the following name servers:
nameserver 161.26.0.7
nameserver 161.26.0.8
This server is part of a Patroni/PostgreSQL cluster and we changed the neplan to let it talk with the other two machines of the same cluster (10.242.23.122 and 10.242.23.126). Here the neplan:
network:
ethernets:
ens3:
dhcp4: true
match:
macaddress: 02:00:07:3c:53:e3
set-name: bond0
ens4:
dhcp4: true
match:
macaddress: 02:00:09:3c:53:e3
set-name: bond1
routes:
- to: 10.242.23.122/32
via: 10.242.87.1
- to: 10.242.151.126/32
via: 10.242.87.1
version: 2
we did the same on other Linux Ubuntu 22 and no issues. The problem is that the routing table of this machine has DNS entries like these:
161.26.0.6 0.0.0.0 255.255.255.255 UH 100 0 0 bond1
161.26.0.6 10.242.151.1 255.255.255.255 UGH 100 0 0 bond0
161.26.0.7 0.0.0.0 255.255.255.255 UH 100 0 0 bond1
161.26.0.7 10.242.151.1 255.255.255.255 UGH 100 0 0 bond0
161.26.0.8 0.0.0.0 255.255.255.255 UH 100 0 0 bond1
161.26.0.8 10.242.151.1 255.255.255.255 UGH 100 0 0 bond0
if I remove them with the command:
route del -net 161.26.0.6 netmask 255.255.255.255 dev bond1
route del -net 161.26.0.7 netmask 255.255.255.255 dev bond1
route del -net 161.26.0.8 netmask 255.255.255.255 dev bond1
I am able to ping an external server using the DNS name (before the DNS removal, it could not be reached). The problem is that a background process add them back again. The lucky part is that this time the faulty entries are added in this way:
161.26.0.6 10.242.151.1 255.255.255.255 UGH 100 0 0 bond0
161.26.0.6 0.0.0.0 255.255.255.255 UH 100 0 0 bond1
161.26.0.7 10.242.151.1 255.255.255.255 UGH 100 0 0 bond0
161.26.0.7 0.0.0.0 255.255.255.255 UH 100 0 0 bond1
161.26.0.8 10.242.151.1 255.255.255.255 UGH 100 0 0 bond0
161.26.0.8 0.0.0.0 255.255.255.255 UH 100 0 0 bond1
so it works because probably the 0.0.0.0 entries are after the one with real gateway. My questions are:
- Why I didn't have the same issues on other Ubuntu 22 machines of other clusters
- What is the background process that add these extra entries?
- Could be my netplan configuration file the root cause of the issue?