Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL***
Hi Rachael, You an use the API from the lease_cmds hook to explore leases: https://kea.readthedocs.io/en/kea-2.2.0/arm/hooks.html#lease-cmds-lease-commands-for-easier-lease-management What I usually do is put the API command in a file, cat the file and pipe it to socat (search for socat in the Kea ARM for example usage) then pipe that output to jq which nicely formats the returned JSON. Thank you, Darren Ankney On Tue, Apr 18, 2023 at 5:47 PM Rachael Wilson wrote: > Thank you for the links, Wlodek! > > > > Here are some sample rows I am loading into the file: > > > > > address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context > > 172.16.16.12,6c:33:a9:3b:2e:04,,3600,1682423972,1,0,0,2e-04,0, > > 172.16.16.25,da:32:2d:70:57:37,,3600,1682423972,1,0,0,57-37,0, > > > > If I’m understanding this properly, the lease should last until the expire > time of 1682423972 which is equivalent to Tue Apr 25 2023 17:49:47 > GMT+. However, if I set the file and wait for the lfc, it empties the > data rows of the lease file, leaving only the header row. Currently the > lfc-interval is set to 3600. > > > > Is there a way to query kea via the cli for the leases it sees other than > opening the lease file? Looked for a log file to see if there is any > information on server startup but even with logging enabled by default, > seems it did not create a log at /var/log/kea-dhcp4.log as per the conf > settings. > > > > > > > > -- > Rachael Wilson > (509) 422-8374 > > *From:* Wlodek Wencel > *Sent:* Friday, April 14, 2023 2:22 AM > *To:* Rachael Wilson ; kea-users@lists.isc.org > *Subject:* Re: [Kea-users] Migrate to Kea from non-ISC DHCP server > ***EXTERNAL EMAIL*** > > > > *EXTERNAL EMAIL: Please Think Before You Click!!* > > > > Kea has two features that deals with expired leases. Please take a look > into lease file clean up: > > https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#memfile-basic-storage-for-leases > (you can easily disable this by setting lfc-interval to 0) and lease > expiration https://kea.readthedocs.io/en/latest/arm/lease-expiration.html > > But none of those processes touch unexpired leases, my guess is that you > are putting incorrect state of a lease. > > There is also lease sanity check feature, but this by default wouldn't > remove your leases > https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#sanity-checks-in-dhcpv4 > > I hope that our documentation will help you find solution. > > Włodek Wencel > > QA, ISC > > On 13/04/2023 21:21, Rachael Wilson wrote: > > Thank you very much Wlodek! With that info I was able to create a lease > file for dhcp4. The only thing is it seems a collector runs at a certain > interval that cleans up the memfile? Looks like it blows out any loaded > leases before they could expire from the old DHCP server. > > > > > > > > > > -- > Rachael Wilson > (509) 422-8374 > > *From:* Kea-users > *On Behalf Of *Wlodek Wencel > *Sent:* Thursday, April 13, 2023 8:48 AM > *To:* kea-users@lists.isc.org > *Subject:* Re: [Kea-users] Migrate to Kea from non-ISC DHCP server > ***EXTERNAL EMAIL*** > > > > *EXTERNAL EMAIL: Please Think Before You Click!!* > > > > Couple simple leases files I took out from our automated testing are > attached. Please be aware that in user context Kea can store quite > extensive info in json structure (also attached). > > Hope that will help > > Wlodek Wencel > > > > On 13/04/2023 16:42, Rachael Wilson wrote: > > Thank you, Darren! I will give perfdhcp a try. > > > > > > > > > > -- > Rachael Wilson > (509) 422-8374 > > *From:* Kea-users > *On Behalf Of *Darren Ankney > *Sent:* Thursday, April 13, 2023 3:27 AM > *To:* kea-users@lists.isc.org > *Subject:* Re: [Kea-users] Migrate to Kea from non-ISC DHCP server > ***EXTERNAL EMAIL*** > > > > *EXTERNAL EMAIL: Please Think Before You Click!!* > > > > > > Hello Rachael, > > > > There probably isn't an example file anywhere in the documentation (I > looked also) or if there is, I just didn't find it. I would suggest > setting up a test kea server with the memfile lease database persisting to > a file. Then use perfdhcp to generate traffic thus populating the file. > If you need specific options to appear in the lease file, it is possible to > use perfdhcp to generate most of them (even if you have to create the hex > yourself). > > > > Thank you, > > > > Darren Ankney > > > > On Wed, Apr 12, 2023 at 5:19 PM Rachael Wils
Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL***
Thank you for the links, Wlodek! Here are some sample rows I am loading into the file: address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context 172.16.16.12,6c:33:a9:3b:2e:04,,3600,1682423972,1,0,0,2e-04,0, 172.16.16.25,da:32:2d:70:57:37,,3600,1682423972,1,0,0,57-37,0, If I’m understanding this properly, the lease should last until the expire time of 1682423972 which is equivalent to Tue Apr 25 2023 17:49:47 GMT+. However, if I set the file and wait for the lfc, it empties the data rows of the lease file, leaving only the header row. Currently the lfc-interval is set to 3600. Is there a way to query kea via the cli for the leases it sees other than opening the lease file? Looked for a log file to see if there is any information on server startup but even with logging enabled by default, seems it did not create a log at /var/log/kea-dhcp4.log as per the conf settings. -- Rachael Wilson (509) 422-8374 From: Wlodek Wencel Sent: Friday, April 14, 2023 2:22 AM To: Rachael Wilson ; kea-users@lists.isc.org Subject: Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL*** EXTERNAL EMAIL: Please Think Before You Click!! Kea has two features that deals with expired leases. Please take a look into lease file clean up: https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#memfile-basic-storage-for-leases (you can easily disable this by setting lfc-interval to 0) and lease expiration https://kea.readthedocs.io/en/latest/arm/lease-expiration.html But none of those processes touch unexpired leases, my guess is that you are putting incorrect state of a lease. There is also lease sanity check feature, but this by default wouldn't remove your leases https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#sanity-checks-in-dhcpv4 I hope that our documentation will help you find solution. Włodek Wencel QA, ISC On 13/04/2023 21:21, Rachael Wilson wrote: Thank you very much Wlodek! With that info I was able to create a lease file for dhcp4. The only thing is it seems a collector runs at a certain interval that cleans up the memfile? Looks like it blows out any loaded leases before they could expire from the old DHCP server. -- Rachael Wilson (509) 422-8374 From: Kea-users <mailto:kea-users-boun...@lists.isc.org> On Behalf Of Wlodek Wencel Sent: Thursday, April 13, 2023 8:48 AM To: kea-users@lists.isc.org<mailto:kea-users@lists.isc.org> Subject: Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL*** EXTERNAL EMAIL: Please Think Before You Click!! Couple simple leases files I took out from our automated testing are attached. Please be aware that in user context Kea can store quite extensive info in json structure (also attached). Hope that will help Wlodek Wencel On 13/04/2023 16:42, Rachael Wilson wrote: Thank you, Darren! I will give perfdhcp a try. -- Rachael Wilson (509) 422-8374 From: Kea-users <mailto:kea-users-boun...@lists.isc.org> On Behalf Of Darren Ankney Sent: Thursday, April 13, 2023 3:27 AM To: kea-users@lists.isc.org<mailto:kea-users@lists.isc.org> Subject: Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL*** EXTERNAL EMAIL: Please Think Before You Click!! Hello Rachael, There probably isn't an example file anywhere in the documentation (I looked also) or if there is, I just didn't find it. I would suggest setting up a test kea server with the memfile lease database persisting to a file. Then use perfdhcp to generate traffic thus populating the file. If you need specific options to appear in the lease file, it is possible to use perfdhcp to generate most of them (even if you have to create the hex yourself). Thank you, Darren Ankney On Wed, Apr 12, 2023 at 5:19 PM Rachael Wilson mailto:racha...@okpud.org>> wrote: Hi, I would like to migrate a few thousand DHCP leases from a non-ISC DHCP server to a memfile backed Kea instance. Looking through the docs, it seems it would be easier to populate the lease file in /var/lib/kea/kea-leases4.csv rather than using hooks. However, in a fresh install the file only contains the header row. Is there an example file populated with rows I could look at to properly format the data for import? Didn’t see anything in the docs, but might have missed it. -- [cid:image001.png@01D971F4.1A948440] Rachael Wilson | Network Analyst Public Utility District No. 1 Of Okanogan County Office: (509) 422-8374 | racha...@okpud.org<mailto:racha...@okpud.org> 1331 2nd Ave N., Okanogan, WA 98840 | P.O. Box 912, Okanogan, WA 98840 P.U.D. No. 1 of Okanogan County is an equal opportunity provider and employer. If you think that you have received this message in error, please e-mail the sender at the above e-mail address. -- ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ f
Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL***
Kea has two features that deals with expired leases. Please take a look into lease file clean up: https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#memfile-basic-storage-for-leases (you can easily disable this by setting lfc-interval to 0) and lease expiration https://kea.readthedocs.io/en/latest/arm/lease-expiration.html But none of those processes touch unexpired leases, my guess is that you are putting incorrect state of a lease. There is also lease sanity check feature, but this by default wouldn't remove your leases https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#sanity-checks-in-dhcpv4 I hope that our documentation will help you find solution. Włodek Wencel QA, ISC On 13/04/2023 21:21, Rachael Wilson wrote: Thank you very much Wlodek! With that info I was able to create a lease file for dhcp4. The only thing is it seems a collector runs at a certain interval that cleans up the memfile? Looks like it blows out any loaded leases before they could expire from the old DHCP server. -- Rachael Wilson (509) 422-8374 *From:* Kea-users *On Behalf Of *Wlodek Wencel *Sent:* Thursday, April 13, 2023 8:48 AM *To:* kea-users@lists.isc.org *Subject:* Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL*** *EXTERNAL EMAIL: Please Think Before You Click!!* Couple simple leases files I took out from our automated testing are attached. Please be aware that in user context Kea can store quite extensive info in json structure (also attached). Hope that will help Wlodek Wencel On 13/04/2023 16:42, Rachael Wilson wrote: Thank you, Darren! I will give perfdhcp a try. -- Rachael Wilson (509) 422-8374 *From:* Kea-users <mailto:kea-users-boun...@lists.isc.org> *On Behalf Of *Darren Ankney *Sent:* Thursday, April 13, 2023 3:27 AM *To:* kea-users@lists.isc.org *Subject:* Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL*** *EXTERNAL EMAIL: Please Think Before You Click!!* Hello Rachael, There probably isn't an example file anywhere in the documentation (I looked also) or if there is, I just didn't find it. I would suggest setting up a test kea server with the memfile lease database persisting to a file. Then use perfdhcp to generate traffic thus populating the file. If you need specific options to appear in the lease file, it is possible to use perfdhcp to generate most of them (even if you have to create the hex yourself). Thank you, Darren Ankney On Wed, Apr 12, 2023 at 5:19 PM Rachael Wilson wrote: Hi, I would like to migrate a few thousand DHCP leases from a non-ISC DHCP server to a memfile backed Kea instance. Looking through the docs, it seems it would be easier to populate the lease file in /var/lib/kea/kea-leases4.csv rather than using hooks. However, in a fresh install the file only contains the header row. Is there an example file populated with rows I could look at to properly format the data for import? Didn’t see anything in the docs, but might have missed it. -- logo__250px.png *Rachael Wilson *| Network Analyst Public Utility District No. 1 Of Okanogan County Office: (509) 422-8374 | racha...@okpud.org 1331 2nd Ave N., Okanogan, WA 98840 | P.O. Box 912, Okanogan, WA 98840 P.U.D. No. 1 of Okanogan County is an equal opportunity provider and employer. If you think that you have received this message in error, please e-mail the sender at the above e-mail address. -- 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@lists.isc.org https://lists.isc.org/mailman/listinfo/kea-users -- 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@lists.isc.org https://lists.isc.org/mailman/listinfo/kea-users
Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL***
Thank you very much Wlodek! With that info I was able to create a lease file for dhcp4. The only thing is it seems a collector runs at a certain interval that cleans up the memfile? Looks like it blows out any loaded leases before they could expire from the old DHCP server. -- Rachael Wilson (509) 422-8374 From: Kea-users On Behalf Of Wlodek Wencel Sent: Thursday, April 13, 2023 8:48 AM To: kea-users@lists.isc.org Subject: Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL*** EXTERNAL EMAIL: Please Think Before You Click!! Couple simple leases files I took out from our automated testing are attached. Please be aware that in user context Kea can store quite extensive info in json structure (also attached). Hope that will help Wlodek Wencel On 13/04/2023 16:42, Rachael Wilson wrote: Thank you, Darren! I will give perfdhcp a try. -- Rachael Wilson (509) 422-8374 From: Kea-users <mailto:kea-users-boun...@lists.isc.org> On Behalf Of Darren Ankney Sent: Thursday, April 13, 2023 3:27 AM To: kea-users@lists.isc.org<mailto:kea-users@lists.isc.org> Subject: Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL*** EXTERNAL EMAIL: Please Think Before You Click!! Hello Rachael, There probably isn't an example file anywhere in the documentation (I looked also) or if there is, I just didn't find it. I would suggest setting up a test kea server with the memfile lease database persisting to a file. Then use perfdhcp to generate traffic thus populating the file. If you need specific options to appear in the lease file, it is possible to use perfdhcp to generate most of them (even if you have to create the hex yourself). Thank you, Darren Ankney On Wed, Apr 12, 2023 at 5:19 PM Rachael Wilson mailto:racha...@okpud.org>> wrote: Hi, I would like to migrate a few thousand DHCP leases from a non-ISC DHCP server to a memfile backed Kea instance. Looking through the docs, it seems it would be easier to populate the lease file in /var/lib/kea/kea-leases4.csv rather than using hooks. However, in a fresh install the file only contains the header row. Is there an example file populated with rows I could look at to properly format the data for import? Didn’t see anything in the docs, but might have missed it. -- [cid:image001.png@01D96E02.891DECD0] Rachael Wilson | Network Analyst Public Utility District No. 1 Of Okanogan County Office: (509) 422-8374 | racha...@okpud.org<mailto:racha...@okpud.org> 1331 2nd Ave N., Okanogan, WA 98840 | P.O. Box 912, Okanogan, WA 98840 P.U.D. No. 1 of Okanogan County is an equal opportunity provider and employer. If you think that you have received this message in error, please e-mail the sender at the above e-mail address. -- 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@lists.isc.org<mailto:Kea-users@lists.isc.org> https://lists.isc.org/mailman/listinfo/kea-users -- 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@lists.isc.org https://lists.isc.org/mailman/listinfo/kea-users
Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL***
Couple simple leases files I took out from our automated testing are attached. Please be aware that in user context Kea can store quite extensive info in json structure (also attached). Hope that will help Wlodek Wencel On 13/04/2023 16:42, Rachael Wilson wrote: Thank you, Darren! I will give perfdhcp a try. -- Rachael Wilson (509) 422-8374 *From:* Kea-users *On Behalf Of *Darren Ankney *Sent:* Thursday, April 13, 2023 3:27 AM *To:* kea-users@lists.isc.org *Subject:* Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL*** *EXTERNAL EMAIL: Please Think Before You Click!!* Hello Rachael, There probably isn't an example file anywhere in the documentation (I looked also) or if there is, I just didn't find it. I would suggest setting up a test kea server with the memfile lease database persisting to a file. Then use perfdhcp to generate traffic thus populating the file. If you need specific options to appear in the lease file, it is possible to use perfdhcp to generate most of them (even if you have to create the hex yourself). Thank you, Darren Ankney On Wed, Apr 12, 2023 at 5:19 PM Rachael Wilson wrote: Hi, I would like to migrate a few thousand DHCP leases from a non-ISC DHCP server to a memfile backed Kea instance. Looking through the docs, it seems it would be easier to populate the lease file in /var/lib/kea/kea-leases4.csv rather than using hooks. However, in a fresh install the file only contains the header row. Is there an example file populated with rows I could look at to properly format the data for import? Didn’t see anything in the docs, but might have missed it. -- logo__250px.png *Rachael Wilson *| Network Analyst Public Utility District No. 1 Of Okanogan County Office: (509) 422-8374 | racha...@okpud.org 1331 2nd Ave N., Okanogan, WA 98840 | P.O. Box 912, Okanogan, WA 98840 P.U.D. No. 1 of Okanogan County is an equal opportunity provider and employer. If you think that you have received this message in error, please e-mail the sender at the above e-mail address. -- 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@lists.isc.org https://lists.isc.org/mailman/listinfo/kea-users address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,state,user_context,hwtype,hwaddr_source 2001:db8:1::50,00:03:00:01:ff:ff:ff:ff:ff:01,4000,1666087048,1,3000,0,14339,128,1,1,a.,ff:ff:ff:ff:ff:01,0,,1,2 address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context 192.168.50.10,ff:01:02:03:ff:04,,4000,1662464562,1,1,1,aa.four.example.com.,0, address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,state,user_context,hwtype,hwaddr_source 2001:db8:1::3,00:03:00:01:01:03:0d:04:0b:01,900,1682357103,1,800,0,1963,128,0,0,,01:03:0d:04:0b:01,0,{ "ISC": { "relay-info": [ { "hop": 0 "link": "2001:db8:1::1000" "options": "0x0012000231350025000A0A002701" "peer": "fe80::800:27ff:fe00:2" "remote-id": "0A002701" } ] } },1,2 2001:db8:1::4,00:03:00:01:01:03:0d:04:0b:01,900,1682357103,1,800,0,1093,128,0,0,,01:03:0d:04:0b:01,0,{ "ISC": { "relay-info": [ { "hop": 0 "link": "2001:db8:1::1000" "options": "0x0012000231350025000A0A002701" "peer": "fe80::800:27ff:fe00:2" "remote-id": "0A002701" } ] } },1,2 2001:db8:3::1:0:0,00:03:00:01:01:03:0d:04:0b:01,900,1682357103,1,800,2,54514,96,0,0,,01:03:0d:04:0b:01,0,{ "ISC": { "relay-info": [ { "hop": 0 "link": "2001:db8:1::1000" "options": "0x0012000231350025000A0A002701" "peer": "fe80::800:27ff:fe00:2" "remote-id": "0A002701" } ] } },1,2 -- 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@lists.isc.org https://lists.isc.org/mailman/listinfo/kea-users
Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL***
Thank you, Darren! I will give perfdhcp a try. -- Rachael Wilson (509) 422-8374 From: Kea-users On Behalf Of Darren Ankney Sent: Thursday, April 13, 2023 3:27 AM To: kea-users@lists.isc.org Subject: Re: [Kea-users] Migrate to Kea from non-ISC DHCP server ***EXTERNAL EMAIL*** EXTERNAL EMAIL: Please Think Before You Click!! Hello Rachael, There probably isn't an example file anywhere in the documentation (I looked also) or if there is, I just didn't find it. I would suggest setting up a test kea server with the memfile lease database persisting to a file. Then use perfdhcp to generate traffic thus populating the file. If you need specific options to appear in the lease file, it is possible to use perfdhcp to generate most of them (even if you have to create the hex yourself). Thank you, Darren Ankney On Wed, Apr 12, 2023 at 5:19 PM Rachael Wilson mailto:racha...@okpud.org>> wrote: Hi, I would like to migrate a few thousand DHCP leases from a non-ISC DHCP server to a memfile backed Kea instance. Looking through the docs, it seems it would be easier to populate the lease file in /var/lib/kea/kea-leases4.csv rather than using hooks. However, in a fresh install the file only contains the header row. Is there an example file populated with rows I could look at to properly format the data for import? Didn’t see anything in the docs, but might have missed it. -- [cid:image001.png@01D96DDB.773E5760] Rachael Wilson | Network Analyst Public Utility District No. 1 Of Okanogan County Office: (509) 422-8374 | racha...@okpud.org<mailto:racha...@okpud.org> 1331 2nd Ave N., Okanogan, WA 98840 | P.O. Box 912, Okanogan, WA 98840 P.U.D. No. 1 of Okanogan County is an equal opportunity provider and employer. If you think that you have received this message in error, please e-mail the sender at the above e-mail address. -- 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@lists.isc.org<mailto:Kea-users@lists.isc.org> https://lists.isc.org/mailman/listinfo/kea-users -- 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@lists.isc.org https://lists.isc.org/mailman/listinfo/kea-users