2

Following up from this question: Wrong IP address from DHCP client on Ubuntu 18.04 .

The TL;DR version of the question above is that Ubuntu has changed from identifying itself to DHCP servers with the MAC address to a unique identifier (presumably) generated when the OS is installed. The solution is to change a config file to restore the old behaviour.

I recently ran into this behaviour when working with a set of VirtualBox VMs. I was working on a project involving communications between a set of servers, so I set up a "base" server with the software I needed then cloned it multiple times. Of course, each cloned server had the same identifier, so they all received the same IP address from our DHCP server.

The answer to the question above solved the problem, but it left me wondering: How can I change the identifier assigned when Ubuntu is installed?

Kryten
  • 241

1 Answers1

2

As I wrote in the thread you linked to, it generates the ID based on /etc/machine-id.

  • The default ClientIdentifier= mode in systemd-networkd is duid, which means the DHCPv4 client ID is based on networkd's DHCPv6 DUID.

  • The default DUIDType= setting in networkd.conf is vendor, which is described as:

    If "DUIDType=vendor", then the DUID value will be generated using "43793" as the vendor identifier (systemd) and hashed contents of machine-id(5). This is the default if DUIDType= is not specified.

The machine-id is also used for generating other identifiers, such as IPv6 addresses, and so should be removed/recreated even if you don't use DHCP.

grawity
  • 501,077