<div dir="ltr">Thanks for the explanation.<br>Do we have any <span class="gmail-ui-provider gmail-gt gmail-b gmail-c gmail-d gmail-e gmail-f gmail-g gmail-h gmail-i gmail-j gmail-k gmail-l gmail-m gmail-n gmail-o gmail-p gmail-q gmail-r gmail-s gmail-t gmail-u gmail-v gmail-w gmail-x gmail-y gmail-z gmail-ab gmail-ac gmail-ae gmail-af gmail-ag gmail-ah gmail-ai gmail-aj gmail-ak" dir="ltr">way to get the current active leases of a server in sync with the configuration file data?<br>Thank you.</span><div><span class="gmail-ui-provider gmail-gt gmail-b gmail-c gmail-d gmail-e gmail-f gmail-g gmail-h gmail-i gmail-j gmail-k gmail-l gmail-m gmail-n gmail-o gmail-p gmail-q gmail-r gmail-s gmail-t gmail-u gmail-v gmail-w gmail-x gmail-y gmail-z gmail-ab gmail-ac gmail-ae gmail-af gmail-ag gmail-ah gmail-ai gmail-aj gmail-ak" dir="ltr"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 8 Jun 2023 at 18:08, 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>
Nothing would stop those leases from still showing up if they are<br>
still active. Since they are not in the lease file, they can be<br>
removed by restarting the server. You could also remove them with<br>
lease4-del API command<br>
(<a href="https://kea.readthedocs.io/en/latest/arm/hooks.html#the-lease4-del-lease6-del-commands" rel="noreferrer" target="_blank">https://kea.readthedocs.io/en/latest/arm/hooks.html#the-lease4-del-lease6-del-commands</a>).<br>
Removing the pool and adding a different pool will not remove active<br>
leases in the pool. Indeed even removing the subnet wouldn't remove<br>
leases. But the leases wouldn't still be shown if the subnet ID is<br>
different in a new subnet.<br>
<br>
On Thu, Jun 8, 2023 at 8:31 AM Shobhith Chikku <<a href="mailto:shobhithchikku@gmail.com" target="_blank">shobhithchikku@gmail.com</a>> wrote:<br>
><br>
> Thanks, Darren,<br>
> The main issue I face is<br>
> 1. I have created a scope 3.0.0.10 - 3.0.0.20<br>
> 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" rel="noreferrer" target="_blank">3.0.0.0/8</a>",<br>
> "valid-lifetime": 86400,<br>
> "option-data": [<br>
> {<br>
> "data": "<a href="http://www.shobhith.com" rel="noreferrer" target="_blank">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.<br>
><br>
> On Thu, 8 Jun 2023 at 17:44, Darren Ankney <<a href="mailto:darren.ankney@gmail.com" target="_blank">darren.ankney@gmail.com</a>> wrote:<br>
>><br>
>> 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>