How to get netplan on 17.10 server to work with a Windows Server DHCP server using MAC address reservations?

To do this on recent Fedora and Arch, it is necessary to set dhcp-client-identifier = hardware to get DHCP to work. I suspect the same is true on 17.10. However, Artful uses netplan and systemd-networkd.

For the latter I can set[DHCP] ClientIdentifier=macIn /etc/systemd/network/(interface name).network, which overrides /run/systemd/network/10-netplan-(ifname).network.

I'd prefer to set this in the file /etc/netplan/01-netcfg.yaml, or something in /etc/netplan/.

These are specifics of how the above might be solved, though. The overall question is how to use the MS Windows Server 2012 DHCP server with MAC reservations with Ubuntu 17.10 server using netplan. I may be able to request reconfiguration of the DHCP server if it won't have a significant effect on other clients, or can be done per-reservation somehow.

(I'd have used the tag windows-server, but it doesn't exist for some reason)

8

2 Answers

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 :

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
2

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.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like