The way DHCP works is that the client makes a network broadcast request for an IP address from a DHCP server using the interface's MAC address in the request packet. The first one to respond is the assigning server. Changing your IP address can be useful if you want to avoid being attacked by other users who are targeting your IP address, or if you simply want a new online identity from an IP standpoint. You can change your IP address on a Mac at any time through System Preferences. The DHCP Client ID that the network adapter sends to the DHCP server is its MAC address. The MAC address ('Media Access Control') is the physical address of a computer, and is the unique serial number burned into every network adapter. The issue: When an iPhone, iPad, or newer Mac gets on our wireless guest network the DHCP server will not assign it an IP unless they fill in the Client ID field in the network settings. One difference is that if I run 'debug ip dhcp server packet' on the server, I can see that the client is sending a DHCPDISCOVER request with the expected client-id: *May 7 20:37:01.067: DHCPD: DHCPDISCOVER received from client 01aa.aabb.bbcc.cc on interface Ethernet0/1.
I'm experiencing a weird issue where my Ubuntu 18.04 (server) box gets issued a wrong IP address during boot from the DHCP server. Running dhclient after boot on the interface results in the right IP being added to the interface.
The DHCP Server is a Windows box where a reservation was manually configured using the MAC address shown by
ip addr in ubuntu (without colons):
50-courtin-networking.cfg (cloud-init cfg)
Journalctl entries for DHCP:
Manually calling dhclient after login (verbose):
10.10.10.10 is the correct DHCP server, and
10.10.10.40 is the IP configured on it. On the Windows DHCP, the wrong lease (.162) shows a long 'Unique ID' that does not contain any MAC address present on the ubuntu box:
What's the right way to avoid this? Deny leases for the long UID? Where does that UID come from in the first place? The NIC is onboard in a Dell PowerEdge R710 server.
Dhcp Client Id On A MacNoMadNoMad
Dhcp Client List On Your Router
The cause of the problem is that the built-in network config of Ubuntu 18.04 no longer uses the NIC Mac address as the default id for DHCP requests.
The traditional (and I believe 'sensible') behavior can be restored by adding
dhcp-identifier: mac to the configuration in the /etc/netplan/xxx.yaml (cloud-init) file as follows:
Where 'nicdevicename' is the name of your network device
to try the new configuration. If you get any errors, please note that precise indentation is very important in .yaml files..
Denying the lease won't work. There's no way networkd could know why it's being denied, so it won't just magically switch to a different ID type if you do so. You have to do that manually.
If your systemd version is recent enough and if you have direct control over the config files written out by cloud-init, you can tell systemd-networkd to send a MAC-address-based client ID via the
But if you know that systemd-networkd will always be used, you can just assign the correct lease to client ID
032e827c00020000ab11d0fc617dced58a43, because that's what systemd-networkd will always send for that machine. (It generates the ID based on
Mos DHCP clients, including dhclient, supply a client-ID field of type '01' (MAC-based). Another common type is '00' (domain name). However, by default, systemd-networkd supplies an 'opaque' client-ID that was generated from the contents of /etc/machine-id.
According to the DHCP protocol, leases are chosen by client ID first (as long as the client supplies a 'client ID' option, which may or may not be MAC-based), then by the MAC address only if the client didn't send an ID.
So when you're configuring a reservation, all good DHCP servers will allow you to enter either the client ID or the MAC address. If you enter just the MAC address, then I suppose that a type-'01' (MAC-based) client ID is automatically implied. There may be a checkbox named 'Ignore client ID', which is convenient for you but technically violates the DHCP spec.
(For example, I have two Wi-Fi adapters with different MACs, but I've configured the OS to send the same client ID no matter which adapter is connected. This way I get the same address via both.)grawitygrawity