Printing the lease start and lease end time for the DHCPv6 leases

Kraishak Mahtha kraishak.edu at gmail.com
Fri Oct 4 08:55:33 UTC 2024


Hi All,

I am currently using ISC DHCPv6 on my local setup, and it works well, for
one of the use cases. I am attempting to print the DUID, lease start time,
and lease end time for each lease entry. While I am able to successfully
print the DUID, I am having trouble retrieving and printing the lease start
and end time variables.

Below is the approach I used to print the DUID:

on commit {
    log(info, concat("DUID:", binary-to-ascii(16, 8, ":", option
dhcp6.client-id)));
    log(info, concat("T1 (Preferred Lifetime): ", binary-to-ascii(10, 32,
"", substring(option dhcp6.ia-na, 4, 4)), " seconds"));
    log(info, concat("T2 (Valid Lifetime): ", binary-to-ascii(10, 32, "",
substring(option dhcp6.ia-na, 8, 4)), " seconds"));
}
```

However, when printing T1 and T2, I am only getting zeros. I've tried
different methods but haven't been able to obtain the correct values for
the lease start and end times.

If anyone with experience in working with these variables could offer
guidance, it would be greatly appreciated.

Thank you in advance!
Kraishak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20241004/d6a4aa3f/attachment.htm>


More information about the dhcp-users mailing list