I just ran into an interesting issue with DHCP. I maintain a cluster of Ubuntu servers for a MooseFS cluster. MooseFS is pretty amazing, it is a clustered filesystem that allows simultaneous access to files from multiple clients. One of the great features of MooseFS is that it has great performance on commodity hardware. So it is relatively inexpensive to Set Up, and Manage. After using it for a while in our initial configuration we decided it was time to upgrade. Specifically to add some additional space in the form of three new chunk server nodes.
The beauty of MooseFS is that space, redundancy and performance can be added by simply adding more nodes. So to make things simple (Not that it is difficult) after we provisioned some new hardware. I simply cloned of one of the existing Chunk servers onto the new hardware. I didn’t realize that I would run into cloned Ubuntu DHCP issues.
Discovering the Cloned Ubuntu DHCP Issues
After I finished the cloning, I plugged in the new server on my work bench to finish up the config changes. Our server setup had a static address for the interfaces we have bonded to handle the MooseFS traffic. But I set the management interface to use DHCP.
The configuration process for the first server went quickly and I left it running while I started on server #2. As soon as server #2 booted up I realized that it had the same IP address as the first server. That sent me checking both servers for any static IP settings or other possible conflicts. But seeing no issues in the config I also checked our DHCP server and noticed that there were several leases to both servers with the same IP.
This got me digging around online for a bit for an answer. I have been using Linux for decades, so some of the newer systems/services keep me learning. In this case it was Netplan, and I installed it with Ubuntu on this machine. I found that Netplan does not use the interface MAC address as the default identifier for DHCP. It uses a generated DUID instead of the MAC address unless you specify otherwise.
I found the issue, as I cloned the chunk server I also cloned the DUID that NetPlan was using. So each clone looked the same to the DHCP server.
Fixing the DHCP Issues
Fortunately the fix for this problem is very simple. The DHCP entry needs to have:
dhcp-identifier: mac
With that line added to your Netplan setup it will default to the MAC address for the interface and your issue should be resolved.
Here is the full config with the new line in place for context. I hope it helps someone avoid the same issue with your own setup.
network: bonds: bond0: addresses: - 172.16.10.25/23 interfaces: - ens1 - ens1d1 nameservers: addresses: - 172.16.10.2 - 172.16.10.3 search: - bdoga.com parameters: lacp-rate: fast mode: 802.3ad transmit-hash-policy: layer3+4 ethernets: eno1: dhcp4: yes dhcp-identifier: mac ens1: {} ens1d1: {} version: 2
If that helped I also recommend this article I wrote about finding a replacement for Netstat.