DHCPd alternates between returning the primary IP assignment and the backup IP
I run lxc containers that make heavy use of dhcp and ddns services. The containers run Ubunut Focal. When I run netplan apply on the containers then they get the primary IP address some times and the backup IP address other times. Both addresses are correctly assigned to the appropriate hosts in the leases file.
To Reproduce Steps to reproduce the behavior:
- netplan apply
- the container sends DHCPRELEASE and starts with reaquiring the IP address.
- The communication flow looks ok but regularly a backup IP address is assigned.
Environment:
-
isc-dhcp-server version 4.3.5-3ubuntu7.1 on the server
-
isc-dhcp-client version 4.4.1-2.1ubuntu5 on the client
-
OS: Server is Ubuntu 16.04.7 LTS
-
OS: Client is Ubuntu 20.04.2 LTS
-
Which features were compiled in
Config file
ddns-updates on;
ddns-update-style interim;
#update-static-leases on;
key "dhcpdupdate" {
algorithm hmac-md5;
secret "blahblahblah==";
};
ddns-domainname "lxc";
#ddns-rev-domainname "in-addr.arpa.";
zone lxc {
primary 127.0.0.2;
key dhcpdupdate;
}
# option definitions common to all supported networks...
option domain-search "lxc", "iron";
option domain-name-servers 10.3.0.214, 10.3.0.118;
default-lease-time 86400;
max-lease-time 86400;
option classless-routes code 121 = array of unsigned integer 8;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
failover peer "failover-partner" {
secondary;
address zed1.server;
port 520;
peer address zabbix1.server;
peer port 519;
max-response-delay 60;
max-unacked-updates 10;
load balance max seconds 3;
}
allow booting;
subnet 10.3.0.0 netmask 255.255.0.0 {
class "kannel" {
match if substring (option host-name, 0, 6) = "kannel";
}
pool {
deny members of "kannel";
failover peer "failover-partner";
range 10.3.0.150 10.3.0.210;
range 10.3.3.2 10.3.3.250;
range 10.3.4.2 10.3.4.250;
option classless-routes 16,10,5,10,3,0,129,16, 10,4, 10,3,0,129,0,10,3,0,129;
filename "pxelinux.0";
}
pool {
allow members of "kannel";
failover peer "failover-partner";
range 10.3.2.10 10.3.2.100;
range 10.3.5.10 10.3.5.100;
option classless-routes
16,10,5,10,3,0,129,16, 10,4, 10,3,0,129,0,10,3,0,113;
}
}
next-server 10.3.0.214;
# insert this (with your own key text substituted) into dhcpd.conf on primary and secondary.
omapi-port 7911;
omapi-key omapi_key;
key omapi_key {
algorithm hmac-md5;
secret moo=;
}
Lease info https://pastebin.com/jf11bcC9 Logs https://pastebin.com/jB1YWZQm
I've chatted on the IRC about this but hit a wall. I'm happy to send out any other information that is necessary or pay for an hour or 2 of an engineers time if it comes down to that.