It is possible by using DUID-UUID.
On the server side it is required to identify the host by option dhcp-client-identifier
like below:
host example {
option dhcp-client-identifier FF:II:II:II:II:00:04:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU;
}
where II
are four bytes of IAID and UU
are sixteen bytes of UUID, FF and 00:04 are literal bytes at these places.
The part starting with 00:04 with the following 16 UUID bytes is DUID-UUID, as described in RFC6355.
Now, DHCPv4 client needs to construct Identity Association Unique Identifier, which is described in section 6.1 of RFC4361. As DHCPv4 only allows HW address or client id as the keys to distinguish different host is has to choose client id (as HW address has fixed definition). It starts with FF byte which identifies client id as DUID based. This is immediately followed by 4 bytes of IAID (don't ask, I don't know) and then DUID. In case of DUID-UUID it starts with 16 bits of identification (4) and is followed by 16 bytes of UUID. Of course other DUID types (see section 9 of RFC3315) can be used as well.
I usually select 0 or 1 as IAID.
Now, on the client side one needs to define DUID and IAID somewhere. As I use AlmaLinux 8.6 and 9.0 I will show how to do it in NetworkManager.
DUID seems to be an identifier attached to specific system, not necessarily interface, so I will put it in /etc/NetworkManager/NetworkManager.conf
file in [connection]
section:
[connection]
ipv4.dhcp-client-id=ipv6-duid
ipv6.dhcp-duid=00:04:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU
The first line indicates that DHCPv4 client id will be based on ipv6-duid, the second defines system wide, default, ipv6.dhcp-duid.
We also need ipv4.dhcp-iaid, which goes into the same section:
[connection]
ipv4.dhcp-iaid=II:II:II:II
ipv4.dhcp-client-id=ipv6-duid
ipv6.dhcp-duid=00:04:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU:UU
NOTE: I am not sure about exact format of ipv4.dhcp-iaid as I usually put single 0 or 1 there which matches 00:00:00:00 or 00:00:00:01 on the server side.
These settings can be also specified per connection. See man nm-settings
for more information.
And for the last thing, I usually generate my system UUID based on its FQDN as below:
uuidgen --sha1 --namespace @dns --name host.example.org
I hope this helps.