[Kea-users] Fetching Active Leases

Darren Ankney darren.ankney at gmail.com
Thu Jun 8 12:14:04 UTC 2023


Hi Shobhith,

It is difficult to answer without seeing your Kea configuration.
Speculation would be that the lease is in memory and either not being
recorded to the file or was removed from the file somehow?  When using
'memfile' for lease storage, the leases are actually in memory.  The
file is only a record that Kea can use to read the leases back into
memory in the case it is restarted.  Its possible to setup memfile,
set a filename, and not have leases written to the file if you have
"persist": false in the lease-database configuration.

Thank you,

Darren Ankney

On Thu, Jun 8, 2023 at 7:10 AM Shobhith Chikku <shobhithchikku at gmail.com> wrote:
>
> Hi,
> When I am trying to fetch active leases, even though my lease file is empty, I am getting leases when I execute
>  /usr/bin/echo '{"command":"lease4-get-all"}' | /usr/bin/socat - UNIX:/opt/tcpwave/timsdhcp/kea4-ctrl-socket | /usr/bin/jq
> Below mentioned is my lease file
> cat /opt/test/dhcp/db/dhcp4.leases
> address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context
> When I execute  lease4-get-all command, I get leases
> {
>   "arguments": {
>     "leases": [
>       {
>         "client-id": "01:2f:ff:ff:00:00:01",
>         "cltt": 1686215869,
>         "fqdn-fwd": false,
>         "fqdn-rev": false,
>         "hostname": "dhcp-client-000001",
>         "hw-address": "2f:ff:ff:00:00:01",
>         "ip-address": "3.0.0.2",
>         "state": 0,
>         "subnet-id": 818110,
>         "valid-lft": 86400
>       } ]
>   },
>   "result": 0,
>   "text": "10 IPv4 lease(s) found."
> }
> Where am I getting this from?
> Thanks in advance
> Shobhith
> --
> ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
>
> To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
>
> Kea-users mailing list
> Kea-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users


More information about the Kea-users mailing list