3

I've cloned two vSphere VMs off of an Ubuntu 17.10 template. After boot, they both claim the same IP and fight for it (ssh connections break off as the IP switches between them).

The hostnames and MAC addresses are different between the two machines. dhclient correctly claims two separate IPs, but the resolver in use is systemd-networkd.

8

systemd-networkd uses a different method to generate the DUID than dhclient. dhclient by default uses the link-layer address while systemd-networkd uses the contents of /etc/machine-id. Since the VMs were cloned, they have the same machine-id and the DHCP server returns the same IP for both.

To fix, replace the contents of one or both of /etc/machine-id. This can be anything, but deleting the file and running systemd-machine-id-setup will create a random machine-id in the same way done on machine setup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.