KEA DHCP leases don't behave like ISC DHCP

Started by os914964619, August 18, 2025, 07:33:20 PM

Previous topic - Next topic
August 19, 2025, 02:56:28 PM #15 Last Edit: August 19, 2025, 03:01:55 PM by hharry
Quote from: sopex8260 on August 19, 2025, 02:34:11 PMSo you choose the advanced config under Kea and it doesn't keep the custom changes?

there is no advanced config custom options in Services: Kea DHCP: Kea DHCPv4

If you had read the link i provided earlier, you would have noticed below are the kea DHCP server lease affinity config options we are after.



OPNsense 25.7.5-amd64 running on ESXi 6.7 U2 VM, 4Gbytes RAM, 2 x vCPU
frr OSPF + eBGP, IDS, AdGuard Home, sftp-backup plugins. limited kea DHCP server deployment.

Quote from: hharry on August 19, 2025, 02:56:28 PM
Quote from: sopex8260 on August 19, 2025, 02:34:11 PMSo you choose the advanced config under Kea and it doesn't keep the custom changes?

there is no advanced config custom options in Services: Kea DHCP: Kea DHCPv4

Manual = Custom

August 19, 2025, 03:04:19 PM #17 Last Edit: August 20, 2025, 04:04:17 AM by hharry
Quote from: sopex8260 on August 19, 2025, 03:02:03 PM
Quote from: hharry on August 19, 2025, 02:56:28 PM
Quote from: sopex8260 on August 19, 2025, 02:34:11 PMSo you choose the advanced config under Kea and it doesn't keep the custom changes?

there is no advanced config custom options in Services: Kea DHCP: Kea DHCPv4

Manual = Custom

oh, now i see what you mean, i now have enabled manual config, so i can take control of /usr/local/etc/kea/kea-dhcp4.conf, and i've added the below config which kea appears to have accepted...after restarting, which should give me 7 hours days of lease affinity...will see if it does what the kea documentation states...


    "expired-leases-processing": {
        "reclaim-timer-wait-time": 10,
        "hold-reclaimed-time": 25200,
        "flush-reclaimed-timer-wait-time": 25
    },
OPNsense 25.7.5-amd64 running on ESXi 6.7 U2 VM, 4Gbytes RAM, 2 x vCPU
frr OSPF + eBGP, IDS, AdGuard Home, sftp-backup plugins. limited kea DHCP server deployment.

Quote from: hharry on August 19, 2025, 03:04:19 PM
Quote from: sopex8260 on August 19, 2025, 03:02:03 PM
Quote from: hharry on August 19, 2025, 02:56:28 PM
Quote from: sopex8260 on August 19, 2025, 02:34:11 PMSo you choose the advanced config under Kea and it doesn't keep the custom changes?

there is no advanced config custom options in Services: Kea DHCP: Kea DHCPv4

Manual = Custom

I'll re-iterate it for you one last time, there is no advanced (manual) config custom options in OPNsesne Services: Kea DHCP: Kea DHCPv4

Okay :)

There is. But then you need to provide the entire configuration manually as a text file.

Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: hharry on August 19, 2025, 03:04:19 PM
Quote from: sopex8260 on August 19, 2025, 03:02:03 PM
Quote from: hharry on August 19, 2025, 02:56:28 PM
Quote from: sopex8260 on August 19, 2025, 02:34:11 PMSo you choose the advanced config under Kea and it doesn't keep the custom changes?

there is no advanced config custom options in Services: Kea DHCP: Kea DHCPv4

Manual = Custom

oh, now i see what you mean, i now have enabled manual config, so i can take control of /usr/local/etc/kea/kea-dhcp4.conf, and i've added the below config which kea appears to have accepted...after restarting, which should give me 7 days of lease affinity...will see if it does what the kea documentation states...


    "expired-leases-processing": {
        "reclaim-timer-wait-time": 10,
        "hold-reclaimed-time": 25200,
        "flush-reclaimed-timer-wait-time": 25
    },


Exactly! Sorry, I thought you would see it sooner :) I wasn't in a computer to provide a screenshot.

so kea successfully gave 7 hours of lease affinity with below config, it behaved exactly according to kea 2.6.3 documentation

    "expired-leases-processing": {
        "reclaim-timer-wait-time": 10,
        "hold-reclaimed-time": 25200,
        "flush-reclaimed-timer-wait-time": 25
    },


Now that testing is done, I've now increased the lease affinity to 30 days (2592000 seconds ), as below....

        "expired-leases-processing": {
            "reclaim-timer-wait-time": 10,
            "hold-reclaimed-time": 2592000,
            "flush-reclaimed-timer-wait-time": 25
        },

OPNsense 25.7.5-amd64 running on ESXi 6.7 U2 VM, 4Gbytes RAM, 2 x vCPU
frr OSPF + eBGP, IDS, AdGuard Home, sftp-backup plugins. limited kea DHCP server deployment.

Quote from: hharry on August 21, 2025, 01:38:32 AMso kea successfully gave 7 hours of lease affinity with below config, it behaved exactly according to kea 2.6.3 documentation

    "expired-leases-processing": {
        "reclaim-timer-wait-time": 10,
        "hold-reclaimed-time": 25200,
        "flush-reclaimed-timer-wait-time": 25
    },


Now that testing is done, I've now increased the lease affinity to 30 days (2592000 seconds ), as below....

        "expired-leases-processing": {
            "reclaim-timer-wait-time": 10,
            "hold-reclaimed-time": 2592000,
            "flush-reclaimed-timer-wait-time": 25
        },



Great to hear! I will try to add it over the next day or two. I will let you know to try it, if you feel brave :)

August 21, 2025, 12:53:48 PM #23 Last Edit: August 21, 2025, 12:56:32 PM by hharry
Quote from: sopex8260 on August 21, 2025, 08:34:51 AM
Quote from: hharry on August 21, 2025, 01:38:32 AMso kea successfully gave 7 hours of lease affinity with below config, it behaved exactly according to kea 2.6.3 documentation

    "expired-leases-processing": {
        "reclaim-timer-wait-time": 10,
        "hold-reclaimed-time": 25200,
        "flush-reclaimed-timer-wait-time": 25
    },


Now that testing is done, I've now increased the lease affinity to 30 days (2592000 seconds ), as below....

        "expired-leases-processing": {
            "reclaim-timer-wait-time": 10,
            "hold-reclaimed-time": 2592000,
            "flush-reclaimed-timer-wait-time": 25
        },



Great to hear! I will try to add it over the next day or two. I will let you know to try it, if you feel brave :)

I already have it implemented, with 30 days of lease affinity, and have no intention of reverting back to having zero lease affinity...be nice if the OPNsense devs would expose the options to the UI so manual control of /usr/local/etc/kea/kea-dhcp4.conf is no longer needed...

wink wink -> https://github.com/opnsense/core/issues/9094
OPNsense 25.7.5-amd64 running on ESXi 6.7 U2 VM, 4Gbytes RAM, 2 x vCPU
frr OSPF + eBGP, IDS, AdGuard Home, sftp-backup plugins. limited kea DHCP server deployment.

Quote from: hharry on August 21, 2025, 12:53:48 PMwink wink -> https://github.com/opnsense/core/issues/9094

This issue is marked as incomplete and so will never be worked on.

If you create an issue you MUST fill in the template instead of just deleting it and replacing it with some text.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

I noticed this when I moved to Kea as well.   but I do not see the issue and do Not want it changed.

the Original Poster needs to create a reservation for that device by Mac address..

Quote from: hharry on August 21, 2025, 12:53:48 PM
Quote from: sopex8260 on August 21, 2025, 08:34:51 AM
Quote from: hharry on August 21, 2025, 01:38:32 AMso kea successfully gave 7 hours of lease affinity with below config, it behaved exactly according to kea 2.6.3 documentation

    "expired-leases-processing": {
        "reclaim-timer-wait-time": 10,
        "hold-reclaimed-time": 25200,
        "flush-reclaimed-timer-wait-time": 25
    },


Now that testing is done, I've now increased the lease affinity to 30 days (2592000 seconds ), as below....

        "expired-leases-processing": {
            "reclaim-timer-wait-time": 10,
            "hold-reclaimed-time": 2592000,
            "flush-reclaimed-timer-wait-time": 25
        },



Great to hear! I will try to add it over the next day or two. I will let you know to try it, if you feel brave :)

I already have it implemented, with 30 days of lease affinity, and have no intention of reverting back to having zero lease affinity...be nice if the OPNsense devs would expose the options to the UI so manual control of /usr/local/etc/kea/kea-dhcp4.conf is no longer needed...

wink wink -> https://github.com/opnsense/core/issues/9094

Yeah, I have seen the github issue. I am willing to fix it/ expose it to the UI for everyone.

Anyway, I will ping you when the code is ready but will probably test it myself since I don't see you being brave enough 😅

Quote from: sopex8260 on August 21, 2025, 01:54:22 PM
Quote from: hharry on August 21, 2025, 12:53:48 PM
Quote from: sopex8260 on August 21, 2025, 08:34:51 AM
Quote from: hharry on August 21, 2025, 01:38:32 AMso kea successfully gave 7 hours of lease affinity with below config, it behaved exactly according to kea 2.6.3 documentation

    "expired-leases-processing": {
        "reclaim-timer-wait-time": 10,
        "hold-reclaimed-time": 25200,
        "flush-reclaimed-timer-wait-time": 25
    },


Now that testing is done, I've now increased the lease affinity to 30 days (2592000 seconds ), as below....

        "expired-leases-processing": {
            "reclaim-timer-wait-time": 10,
            "hold-reclaimed-time": 2592000,
            "flush-reclaimed-timer-wait-time": 25
        },



Great to hear! I will try to add it over the next day or two. I will let you know to try it, if you feel brave :)

I already have it implemented, with 30 days of lease affinity, and have no intention of reverting back to having zero lease affinity...be nice if the OPNsense devs would expose the options to the UI so manual control of /usr/local/etc/kea/kea-dhcp4.conf is no longer needed...

wink wink -> https://github.com/opnsense/core/issues/9094

Yeah, I have seen the github issue. I am willing to fix it/ expose it to the UI for everyone.

Anyway, I will ping you when the code is ready but will probably test it myself since I don't see you being brave enough 😅

Thank your Sir, i'm always to happy to test code etc, already have a sandbox pre-production envionment allways available for use...
OPNsense 25.7.5-amd64 running on ESXi 6.7 U2 VM, 4Gbytes RAM, 2 x vCPU
frr OSPF + eBGP, IDS, AdGuard Home, sftp-backup plugins. limited kea DHCP server deployment.

Quote from: hharry on August 21, 2025, 01:57:14 PM
Quote from: sopex8260 on August 21, 2025, 01:54:22 PM
Quote from: hharry on August 21, 2025, 12:53:48 PM
Quote from: sopex8260 on August 21, 2025, 08:34:51 AM
Quote from: hharry on August 21, 2025, 01:38:32 AMso kea successfully gave 7 hours of lease affinity with below config, it behaved exactly according to kea 2.6.3 documentation

    "expired-leases-processing": {
        "reclaim-timer-wait-time": 10,
        "hold-reclaimed-time": 25200,
        "flush-reclaimed-timer-wait-time": 25
    },


Now that testing is done, I've now increased the lease affinity to 30 days (2592000 seconds ), as below....

        "expired-leases-processing": {
            "reclaim-timer-wait-time": 10,
            "hold-reclaimed-time": 2592000,
            "flush-reclaimed-timer-wait-time": 25
        },



Great to hear! I will try to add it over the next day or two. I will let you know to try it, if you feel brave :)

I already have it implemented, with 30 days of lease affinity, and have no intention of reverting back to having zero lease affinity...be nice if the OPNsense devs would expose the options to the UI so manual control of /usr/local/etc/kea/kea-dhcp4.conf is no longer needed...

wink wink -> https://github.com/opnsense/core/issues/9094

Yeah, I have seen the github issue. I am willing to fix it/ expose it to the UI for everyone.

Anyway, I will ping you when the code is ready but will probably test it myself since I don't see you being brave enough 😅

Thank your Sir, i'm always to happy to test code etc, already have a sandbox pre-production envionment allways available for use...

Would appreciate your feedback on this:

opnsense-patch -a sopex -c core c6d7453d5809d948df6f29eba32b6aee39b02227

Quote from: sopex8260 on August 21, 2025, 04:40:26 PM
Quote from: hharry on August 21, 2025, 01:57:14 PM
Quote from: sopex8260 on August 21, 2025, 01:54:22 PM
Quote from: hharry on August 21, 2025, 12:53:48 PM
Quote from: sopex8260 on August 21, 2025, 08:34:51 AM
Quote from: hharry on August 21, 2025, 01:38:32 AMso kea successfully gave 7 hours of lease affinity with below config, it behaved exactly according to kea 2.6.3 documentation

    "expired-leases-processing": {
        "reclaim-timer-wait-time": 10,
        "hold-reclaimed-time": 25200,
        "flush-reclaimed-timer-wait-time": 25
    },


Now that testing is done, I've now increased the lease affinity to 30 days (2592000 seconds ), as below....

        "expired-leases-processing": {
            "reclaim-timer-wait-time": 10,
            "hold-reclaimed-time": 2592000,
            "flush-reclaimed-timer-wait-time": 25
        },



Great to hear! I will try to add it over the next day or two. I will let you know to try it, if you feel brave :)

I already have it implemented, with 30 days of lease affinity, and have no intention of reverting back to having zero lease affinity...be nice if the OPNsense devs would expose the options to the UI so manual control of /usr/local/etc/kea/kea-dhcp4.conf is no longer needed...

wink wink -> https://github.com/opnsense/core/issues/9094

Yeah, I have seen the github issue. I am willing to fix it/ expose it to the UI for everyone.

Anyway, I will ping you when the code is ready but will probably test it myself since I don't see you being brave enough 😅

Thank your Sir, i'm always to happy to test code etc, already have a sandbox pre-production envionment allways available for use...

Would appreciate your feedback on this:

opnsense-patch -a sopex -c core c6d7453d5809d948df6f29eba32b6aee39b02227

patch worked, without any issue, and i found the UI options you added to be intuitive and effective, and built the correct / expected config in /usr/local/etc/kea/kea-dhcp4.conf

Thank you sir, very well done. Let me know if you'd like some test artifacts, screenshots etc...that may help with pull request / check in etc...

OPNsense 25.7.5-amd64 running on ESXi 6.7 U2 VM, 4Gbytes RAM, 2 x vCPU
frr OSPF + eBGP, IDS, AdGuard Home, sftp-backup plugins. limited kea DHCP server deployment.