Printing the lease start and lease end time for the DHCPv6 leases
Kraishak Mahtha <[email protected]> Fri, 4 Oct 2024 14:25:33 +0530
| Newsgroups | gmane.network.dhcp.isc.dhcp-server |
|---|---|
| Message-ID | <CADDat868EwWov_y4dpOVE48TP-h7N=Y0rL0CBjNitweCNMdvQg@mail.gmail.com> |
--===============2956530349661528743==
Content-Type: multipart/alternative; boundary="0000000000002ff49a0623a2d6b1"
--0000000000002ff49a0623a2d6b1
Content-Type: text/plain; charset="UTF-8"
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
--0000000000002ff49a0623a2d6b1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi All,=C2=A0<div><br></div><div>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 eac=
h 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.<br>=
</div><div><br>Below is the approach I used to print the DUID:<br><br>on co=
mmit {<br>=C2=A0 =C2=A0 log(info, concat("DUID:", binary-to-ascii=
(16, 8, ":", option dhcp6.client-id)));<br>=C2=A0 =C2=A0 log(info=
, concat("T1 (Preferred Lifetime): ", binary-to-ascii(10, 32, &qu=
ot;", substring(option dhcp6.ia-na, 4, 4)), " seconds"));<br=
>=C2=A0 =C2=A0 log(info, concat("T2 (Valid Lifetime): ", binary-t=
o-ascii(10, 32, "", substring(option dhcp6.ia-na, 8, 4)), " =
seconds"));<br>}<br>```<br><br>However, when printing T1 and T2, I am =
only getting zeros. I've tried different methods but haven't been a=
ble to obtain the correct values for the lease start and end times.<br><br>=
If anyone with experience in working with these variables could offer guida=
nce, it would be greatly appreciated.<br><br>Thank you in advance!<br>Krais=
hak</div><div><br></div></div>
--0000000000002ff49a0623a2d6b1--
--===============2956530349661528743==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
dhcp-users mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/dhcp-users
--===============2956530349661528743==--