[OpenIndiana-discuss] How to configure a DUID for DHCPv6 usage?

Henner Gratz hpg at uni-bremen.de
Fri Apr 15 14:51:50 UTC 2016


On 04/15/2016 03:09 PM, James Carlson wrote:
> On 04/15/16 08:46, Henner Gratz wrote:
>> Thank you very much for your quick response. Because I'm no fan of endless
>> debugging sessions, I've followed your second advice and got the source of
>> dhcpagent and libdhcpagent. And after a first look at it I think that the
>> code isn't able to parse a DUID of type 1 (and that's the only type DHCPv6
>> supports for the identification of a client). The time in this DUID is only
> What do you mean by "only type DHCPv6 supports?"
>
> As far as the server is concerned, a DUID is just a bag of bits.  The
> innards can be (and *should* be) treated as opaque by the server.  The
> type number is there just for convenience of logging and display in
> management tools.  If there's a server out there that's so broken that
> it tries to "validate" the contents of a DUID and rejects certain types,
> then my advice would be to start running -- fast -- in the opposite
> direction.  Who knows what else is horribly broken?
>
> See RFC 3315 section 9.  It clearly calls out that DUIDs are opaque, and
> the only thing that makes sense with them is equality comparison.
>
>> there to make it even less likely that two identical IDs exist. Once a DUID
>> of type 1 is created it should be stored in a save place (OI/Solaris use
>> /etc/dhcp/duid) and the time won't be changed again. So a DHCPv6 server is
>> able to recognise a client - even after it has rebooted.
> If I recall correctly, the constructed DUID is stored in stable storage
> once created.  Look for the write_stable_duid() and read_stable_duid().
>   They're in the dhcp_stable.c file in libdhcpagent.
>
> Type 1 should work fine.  The user interface just provides no way to
> specify the "time" portion of the DUID.  That is constructed
> automatically.  You must specify "1,<hwaddr>,<hwaddress>", and dhcpagent
> will add in the current time, and store the resulting DUID in a file
> named /etc/dhcp/duid.
>
>> And I think that there is a bug in the function get_smach_cid, because it's
>> not even expected, that the string is DUID of type 1. The code just expects
>> a DUID of type 3. But I hadn't much time to look at the source, I will take
>> a closer look on the week-end. Hope this will result in a dhcpagent binary
>> that also works for DHCPv6 clients with fixex addresses. Wish me luck...
> I don't understand that response.
>
> The code doesn't just "expect" a DUID of type 3.  What it does is parse
> a string of the format "1,<hwtype>,<hwaddress>", and then it
> automatically inserts the current time of day when it constructs the
> type 1 DUID.
>
> I'm pretty sure the only problem you had was setting the correct format
> in the configuration file.
>

Hello again!

Mea culpa, I just re-read all the texts I had used the last days and it 
seems that
I simply misunderstood which DUID types are allowed for IPv4 and IPv6.
Very embarrassing...

But I still think (or better now: 'hope' :*) that there's something 
wrong with the
source of dhcpagent. I've just tried a DUID-LL (type 3) and still got a 
wrong address.
But I will study the source more closely before I make a fool of me again.

So please excuse my ignorance (and stand-by :)


Regards,

     Henner




More information about the openindiana-discuss mailing list