DHCP conflicts on two Ubuntu 18.04 servers

dhcpnetplanubuntu-18.04windows-server-2012-r2

I have two machines running Ubuntu 18.04 server edition. Networking go through netplan. They get their IPv4 from a DHCP server v6.3 running on Windows Server 2012 R2. For some reason, they don't provide their MAC address but a very long hardware-type. And for some reason, both machines provide the same Client-ID, then the DHCP replies with the same IP address, leading to IP conflicts on my network. I tcpdump'ed DHCP requests when both machines boot:

https://pastebin.com/AFZzNqd5

We can see that machines e0:d5:5e:b0:ed:49 and e0:d5:5e:8f:a6:b0 both advertises the same Client-ID. What's wrong with my Ubuntu server configuration?

Best Answer

Ubuntu server default networking goes through cloud-init which by default sends /etc/machine-id in the DHCP request. I have not made these ID unique and my two machines send the same, thus DHCP server replied with the same IP address to both machines, leading to conflict. So using the MAC address as DHCP-identifier as mentioned in this solution worked for me:

https://superuser.com/a/1369369/131772

I also make /etc/machine-id unique for each machine.