How to get netplan on 17.10 server to work with a Windows Server DHCP server using MAC address reservations?
I recently encountered this as well. The answer is in the netplan.io examples. You can add the line dhcp-identifier: mac
to the yaml file in /etc/netplan/ and then run netplan apply
to apply the change immediately.
From the last item on https://netplan.io/examples:
Windows DHCP Server
For networks where DHCP is provided by a Windows Server using the dhcp-identifier key allows for interoperability:
network: version: 2 ethernets: enp3s0: dhcp4: yes dhcp-identifier: mac
For those that just need a quick solution while waiting for Ubuntu to pull this bugfix from upstream:
sudo rm /etc/machine-id
sudo systemd-machine-id-setup
sudo reboot
This solves the duplicate IP issue by forcing the Ubuntu client to generate a new machine-id which in turn causes netplan/networkd to generate a new DUID so you'll get a new IP address from your DHCP server as you would expect.
So it's not really reading the MAC that was changed after the clone, but generating a new DUID for the post-clone OS.
Essentially, this is newsid for Linux.