DCHPD IPv6 leases

Timothe Litt litt at acm.org
Fri Jan 16 03:53:51 UTC 2015


I'm working on updating a tool that uses lease status from the dhcpd
leases file, and would like to teach it about IPv6.

I'm not running dhcpd IPv6 (yet - I have a static IPv6 network), but
have found some sample IPv6 lease data.
That file, and everything else points to the dhcpd.leases (5) man page. 
However, that man page doesn't
describe the IPv6 leases.  Just the IPv4.

A snippet below (again, not my file...) leaves me guessing.  I admit to
not having read all the DHCP6
RFCs, but I shouldn't have to for this.

    I assume that the ia-na argument is the client's DUID.  But if it's
    a standard type, it would
    appear to not be in network byte order.  E.g. a LLT would be
    \000\001 (like the server DUID),
    but what we see is byte-swapped - so perhaps it's in native order
    from a little-endian machine.
    But if that's the case, the hardware type isn't swapped - presuming
    ethernet, but the string
    decodes to the wrong length. (TYPE+HWT+TIME+Ethernet = 2+2+4+6 = 14
    bytes, vs. 19 in the
    string.) Only 4 DUID formats are registered with IANA...

    The code in print.c (quotify) called by db.c just walks a pointer
    down a field; I haven't (and
    don't really want to) worked backwards to the source.

    I assume ia-na represents non-temporary addresses for this client;
    ia-ta temporary addresses,
    and ia-pd - prefix delegation? And that a client can have many
    addresses.

    And that the iaaddr ip:: {} record sets represent a lease roughly
    like the lease ip... {} records written
    by dhcpd for IPv4 and documented on the man page.  Though I don't
    see 'start'; is that a sample
    data issue, or is only the last transaction time (cltt) recorded?

But, what I'd really like is:

1) The real documentation for dhcpd6.leases, so I don't have to reverse
engineer it.
2) Some reasonable test data showing a useful number of leases in as
many states as possible.
3) Preference on display of DUIDs - the quoted string format isn't human
friendly.  I've seen other software present it as a ':' separated byte
string, though IPV6 address-style 16-bit chunks would seem more compact..

The lack of documentation strikes me as a bug - but I thought I should
ask here before writing a
bug report...

If this turns into a big project, I'll drop it.  I'm not going to 'read
all the code', 'setup a test network', or 'read all the RFCs.' :-)
So any help would be appreciated.

Thanks. 


# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.0-P2

server-duid "\000\001\000\001\024\355d\360\000 5\347\331v";

ia-na "\001\000\000\000\000\001\000\001\024\330\204\230\010\000'[ \363" {
  cltt 0 2011/03/20 16:44:56;
}

ia-na "@\010\224'\000\001\000\001\024\355jX\010\000'\224\010@" {
  cltt 3 2011/03/09 04:39:42;
}

ia-na "\001\000\000\000\000\001\000\001\024\352\033$\010\000'*\230\202" {
  cltt 1 2011/03/28 01:49:55;
  iaaddr 2001:470:8:12:9000::200 {
    binding state active;
    preferred-life 2250
    max-life 3600
    ends 1 2011/03/28 02:49:55;
    set ddns-rev-name =
"0.0.2.0.0.0.0.0.0.0.0.0.0.0.0.9.2.1.0.0.8.0.0.0.0.7.4.0.1.0.0.2.ip6.arpa.";
    set ddns-txt = "02ce74620e7758348976d8a9df6d7939d7";
    set ddns-fwd-name = "xxx.example.net";
  }
}
 

-- 
Timothe Litt
ACM Distinguished Engineer
--------------------------
This communication may not represent the ACM or my employer's views,
if any, on the matters discussed. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20150115/afe2886e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4942 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20150115/afe2886e/attachment.bin>


More information about the dhcp-users mailing list