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

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


> >/Hi all, /> >//> >/I want an OI_151a9 machine to get a fixed IPv6 address via DHCPv6. For /> >/that to work /> >/a DHCP Unique Identifier (DUID) has to be set on this machine. According /> >/to the manuals /> >/a line of the form /> >//> >/.v6.CLIENT_ID=DUID /> >//> >/has to be added to the file /etc/default/dhcpagent for that. /> >//> >/So I added the line /> >//> >/.v6.CLIENT_ID=1,1,1,08:00:27:92:28:9b />
> It's been a very long time since I wrote that code, but I think that
> format is incorrect.
>
> First of all, DUID type 1 is (per RFC 3315) "Link-layer address plus
> time."  In other words, you get a different DUID every time you ask for
> an address.  That's almost certainly not what you want.  (The "time"
> portion is automatically inserted -- you can't set it manually, at least
> according to how I read the code.)
>
> Second, when using types 1 and 3, the format looks like "1,1,08:00:..."
> -- there are just three fields (DUID type, hardware type, and address),
> not four as given above, and I see no way the code will handle an
> interface name.  I think the man page is just plain in error here.
>
> I would try using:
>
> .v6.CLIENT_ID=3,1,08:00:27:92:28:9b
>
> >/Any advice? />
> dhcpagent also logs its activity via syslog using facility "daemon."  I
> highly recommend looking there for hints about what's going wrong (and
> increase log level to "debug" to see more).
>
> In case you're having trouble with the server, snoop or Ethereal should
> help in finding out what's actually on the wire.
>
> The slightly swilly code I wrote to do this parsing is in the
> get_smach_cid function, located in
> usr/src/cmd/cmd-inet/sbin/dhcpagent/states.c.  I don't know if anyone
> else has worked on it, though.
>
> --
> James Carlson         42.703N 71.076W         <carlsonj at workingcode.com 
<http://openindiana.org/mailman/listinfo/openindiana-discuss>>


Hi James,

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
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.

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...

Thank you very much for your pointers! I think your comment helped me a lot.


Regards,

    Henner



More information about the openindiana-discuss mailing list