<div dir="ltr">Thanks, Darren,<br>The main issue I face is <br>1. I have created a scope 3.0.0.10 - 3.0.0.20<div>2. I have generated leases from that scope.<br>3. I deleted that scope and created another one in the same subnet 3.0.0.50 - 3.0.0.100.<br>4. When I fetch the active lease, I am also getting the leases from the deleted scope 3.0.0.10 - 3.0.0.20 also ( I shouldn't get them right?).<br>How do I solve this?<br>I tried the LFC process, which only cleans up the leases from the lease file, but the memory still has them.<br>Here is my config file.<br>{"Dhcp4": {<br> "interfaces-config": {"interfaces": ["eth0"]},<br> "authoritative": true,<br> "multi-threading": {<br> "packet-queue-size": 16,<br> "enable-multi-threading": true,<br> "thread-pool-size": 4<br> },<br> "loggers": [{<br> "debuglevel": 55,<br> "severity": "DEBUG",<br> "output_options": [{<br> "output": "/var/log/kea-dhcp4.log",<br> "flush": true,<br> "maxsize": 204800<br> }],<br> "name": "kea-dhcp4"<br> }],<br> "lease-database": {<br> "name": "/opt/dhcp/dhcp/db/dhcp4.leases",<br> "persist": true,<br> "type": "memfile",<br> "lfc-interval":60,<br> },<br> "hooks-libraries": [{"library": "/opt/dhcp/lib/kea/hooks/libdhcp_lease_cmds.so"}],<br> "server-hostname": "server-47",<br> "control-socket": {<br> "socket-type": "unix",<br> "socket-name": "/opt/dhcp/dhcp/kea4-ctrl-socket"<br> },<br> "decline-probation-period": 7200,<br> "sanity-checks": {"lease-checks": "fix-del"},<br> "subnet4": [{<br> "subnet": "<a href="http://3.0.0.0/8">3.0.0.0/8</a>",<br> "valid-lifetime": 86400,<br> "option-data": [<br> {<br> "data": "<a href="http://www.shobhith.com">www.shobhith.com</a>",<br> "name": "domain-name"<br> },<br> {<br> "data": "86400",<br> "name": "dhcp-lease-time"<br> },<br> {<br> "data": "255.0.0.0",<br> "name": "subnet-mask"<br> },<br> {<br> "data": "3.0.0.1",<br> "name": "routers"<br> }<br> ],<br> "pools": [{<br> "client-class": "allow-client",<br> "pool": "3.0.0.50-3.0.0.100"<br> }],<br> "id": 818110<br> }],<br> "client-classes": [<br> {"name": "deny-client"},<br> {<br> "test": "(not(member('deny-client')))",<br> "name": "allow-client"<br> }<br> ]<br>}}<br>Thank you.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 8 Jun 2023 at 17:44, Darren Ankney <<a href="mailto:darren.ankney@gmail.com">darren.ankney@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Shobhith,<br>
<br>
It is difficult to answer without seeing your Kea configuration.<br>
Speculation would be that the lease is in memory and either not being<br>
recorded to the file or was removed from the file somehow? When using<br>
'memfile' for lease storage, the leases are actually in memory. The<br>
file is only a record that Kea can use to read the leases back into<br>
memory in the case it is restarted. Its possible to setup memfile,<br>
set a filename, and not have leases written to the file if you have<br>
"persist": false in the lease-database configuration.<br>
<br>
Thank you,<br>
<br>
Darren Ankney<br>
<br>
On Thu, Jun 8, 2023 at 7:10 AM Shobhith Chikku <<a href="mailto:shobhithchikku@gmail.com" target="_blank">shobhithchikku@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
> When I am trying to fetch active leases, even though my lease file is empty, I am getting leases when I execute<br>
> /usr/bin/echo '{"command":"lease4-get-all"}' | /usr/bin/socat - UNIX:/opt/tcpwave/timsdhcp/kea4-ctrl-socket | /usr/bin/jq<br>
> Below mentioned is my lease file<br>
> cat /opt/test/dhcp/db/dhcp4.leases<br>
> address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context<br>
> When I execute lease4-get-all command, I get leases<br>
> {<br>
> "arguments": {<br>
> "leases": [<br>
> {<br>
> "client-id": "01:2f:ff:ff:00:00:01",<br>
> "cltt": 1686215869,<br>
> "fqdn-fwd": false,<br>
> "fqdn-rev": false,<br>
> "hostname": "dhcp-client-000001",<br>
> "hw-address": "2f:ff:ff:00:00:01",<br>
> "ip-address": "3.0.0.2",<br>
> "state": 0,<br>
> "subnet-id": 818110,<br>
> "valid-lft": 86400<br>
> } ]<br>
> },<br>
> "result": 0,<br>
> "text": "10 IPv4 lease(s) found."<br>
> }<br>
> Where am I getting this from?<br>
> Thanks in advance<br>
> Shobhith<br>
> --<br>
> ISC funds the development of this software with paid support subscriptions. Contact us at <a href="https://www.isc.org/contact/" rel="noreferrer" target="_blank">https://www.isc.org/contact/</a> for more information.<br>
><br>
> To unsubscribe visit <a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/kea-users</a>.<br>
><br>
> Kea-users mailing list<br>
> <a href="mailto:Kea-users@lists.isc.org" target="_blank">Kea-users@lists.isc.org</a><br>
> <a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/kea-users</a><br>
-- <br>
ISC funds the development of this software with paid support subscriptions. Contact us at <a href="https://www.isc.org/contact/" rel="noreferrer" target="_blank">https://www.isc.org/contact/</a> for more information.<br>
<br>
To unsubscribe visit <a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/kea-users</a>.<br>
<br>
Kea-users mailing list<br>
<a href="mailto:Kea-users@lists.isc.org" target="_blank">Kea-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/kea-users</a><br>
</blockquote></div>