Does anyone know how a DHCP IAID is generated for a DUID-UUID?
The spec says it needs to be consistent across reboots and suggests that it either be stored persistently or algorithmically generated but doesn’t provide guidance on how to do that.
I assume in practice this means hashing the hardware MAC address of the interface, possibly along with some other stuff, but can’t find specific mention of it and I’m not savvy enough to find it in the code…
I want to manually generate a type 4 DUID. The only part I haven’t been able to figure out is the IAID section.
I suspect that NetworkManager, networkd, etc may generate these differently. Either/both/all implementations would be fine. I just want to do something that is already in practice.
Looks like it happens here (in networkd):
if (name) id = siphash24(name, strlen(name), HASH_KEY.bytes);
If I had to guess, name
is probably the systemd persistent interface naming (enps0 for instance) but I don’t know what these do:
#define HASH_KEY SD_ID128_MAKE(80,11,8c,c2,fe,4a,03,ee,3e,d6,0c,6f,36,39,14,09)
It’s also interesting to me that the DUID spec includes a header indicating the DUID type. Why does the DHCP server need to know about the DUID type at all? Each type should be unique and persistent which is all that the server should care about, right?
@PhaseLockedLoop you ever look into this?