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

17.10active-directorydhcpnetplanwindows

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=mac

In /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)

Best Answer

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