DHCPv6 IP<->DUID mapping ?

perl-list perl-list at network1.net
Fri Aug 18 14:35:35 UTC 2017


This produces some nice log output that can be parsed for DUID and other important tidbits: 

on commit { 

if exists dhcp6.ia-na { 

log(debug, 

concat( "LEASED,", 

"IP,",binary-to-ascii(16, 16, ":", substring(option dhcp6.ia-na,16,16)),",", 

"IPTIME,",binary-to-ascii(10, 32, "", substring(option dhcp6.ia-na,36,4)),",", 

"DUID,",binary-to-ascii(16, 8, ":", option dhcp6.client-id),",", 

"DUIDTYPE,",binary-to-ascii(10, 16, "", substring(option dhcp6.client-id,0,2)),",", 

"DUIDHWTYPE,",binary-to-ascii(10, 16, "", substring(option dhcp6.client-id,2,2)),",", 

"POSSIBLEMAC,",binary-to-ascii(16, 8, ":", suffix(option dhcp6.client-id,6)) 

) 

); 

} 

if exists dhcp6.ia-pd { 

log(debug, 

concat( "LEASED,", 

"PD,",binary-to-ascii(16, 16, ":", substring(option dhcp6.ia-pd,25,16)),",", 

"PDLENGTH,",binary-to-ascii(10, 8, "", substring(option dhcp6.ia-pd,24,1)),",", 

"PDTIME,",binary-to-ascii(10, 32, "", substring(option dhcp6.ia-pd,20,4)),",", 

"DUID,",binary-to-ascii(16, 8, ":", option dhcp6.client-id),",", 

"DUIDTYPE,",binary-to-ascii(10, 16, "", substring(option dhcp6.client-id,0,2)),",", 

"DUIDHWTYPE,",binary-to-ascii(10, 16, "", substring(option dhcp6.client-id,2,2)),",", 

"POSSIBLEMAC,",binary-to-ascii(16, 8, ":", suffix(option dhcp6.client-id,6)) 

) 

); 

} } 

It should be noted that these lines: 

"IPTIME,",binary-to-ascii(10, 32, "", substring(option dhcp6.ia-na,36,4)),",", 
"PDTIME,",binary-to-ascii(10, 32, "", substring(option dhcp6.ia-pd,20,4)),",", 

which SHOULD give the length of the lease actually give you the length that the client requested which may or may not match the length subsequently allocated. ISC did confirm to me that this was a bug. No idea if they plan to fix it. 

> From: "Hillary Nelson" <nelsonhillary8 at gmail.com>
> To: "Users of ISC DHCP" <dhcp-users at lists.isc.org>
> Sent: Friday, August 18, 2017 10:14:57 AM
> Subject: DHCPv6 IP<->DUID mapping ?

> We plan to enable IPv6 registration like we do with our IPv4(with deny unknown
> clients), which needs query lease info to get DUID from giving IPv6 address,
> without omapi support, should we parse lease or log to get DUID from IPv6
> address? How do you folks get your DHCPv6 IPv6<->DUID mapping?

> If anyone has done IPv6 registration and would like to share your experience, it
> will be greatly appreciated!! You contact me off list if you want..

> Best,
> Hillary

> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20170818/4250320c/attachment-0001.html>


More information about the dhcp-users mailing list