Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Kea DHCP stops working

    Scheduled Pinned Locked Moved DHCP and DNS
    61 Posts 16 Posters 9.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      datpif
      last edited by

      I see this is still ongoing. I found a workaround via watchdog service. The script does a cleanup before attempting to restart the sevice

      • list itemmake sure you install the watchdog service in pfsense.

      • list Add the kea dhcp 4 service.

      • Shell into pfsense and change to /usr/local/etc/rc.d

      • list Create a backup of kea service script. cp kea kea.old

      • list edit the kea file and replace contents with script below

      #!/bin/sh
      
      # PROVIDE: kea
      # REQUIRE: NETWORK netif routing    
      # KEYWORD: shutdown
      
      . /etc/rc.subr
      
      name=kea
      desc="Kea DHCP Server"
      rcvar=kea_enable
      
      load_rc_config $name
      
      kea_enable=${kea_enable:-"NO"}
      
      command="/usr/local/sbin/keactrl"
      required_files="/usr/local/etc/${name}/keactrl.conf"
      
      # Add cleanup function
      cleanup_kea() {
          # Clean up stale lock files
          rm -f /tmp/kea4-ctrl-socket.lock
          # Kill any zombie processes
          pkill -9 kea-dhcp4
          # Wait for processes to die
          sleep 2
      }
      
      # Modify start command to include cleanup
      start_cmd() {
          cleanup_kea
          ${command} start
          logger -t kea-watchdog "Kea DHCP4 started with cleanup"
      }
      
      # Modify stop command to include cleanup
      stop_cmd() {
          ${command} stop
          cleanup_kea
          logger -t kea-watchdog "Kea DHCP4 stopped with cleanup"
      }
      
      status_cmd="$command status"
      reload_cmd="$command reload"
      extra_commands="reload"
      
      run_rc_command "$1"
      

      Watchdog should auto restart the service

      D N 2 Replies Last reply Reply Quote 0
      • D
        datpif @datpif
        last edited by

        @datpif Actually just found watchdog starts a different service . so the simplest fix i found was to edit

        • /etc/inc/service-utils.inc

        • search for case 'kea-dhcp4':

        • and add

                        case 'kea-dhcp4':
                              exec("rm -f /tmp/kea4-ctrl-socket.lock");
        
        
        1 Reply Last reply Reply Quote 0
        • N
          noisyjohn @datpif
          last edited by

          @datpif yeap! clever. I knew this problem /tmp/kea4-ctrl-socket.lock"". But this automation is grate. Thanks for this. But it is still a work around, not a fix. I wander if anyone in KEA will take care of this.
          However I'm gona say goodby to KEA. The reason:
          KEA does not register the DHCP clients in dns resolver, so my local net (5 pcs) never works as I want. I have read somewhere that it' does it automaticaly, but it does not. And there is no option "register dhcp clients" as the older ISC DHCP does.

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            It does in 24.11.

            1 Reply Last reply Reply Quote 0
            • G
              Gerry555
              last edited by Gerry555

              Any sign if this issue is road mapped to be been corrected?
              This issue is still occurring on the latest version 24.11

              DHCP just stops. It will restart successfully when I login and manually restart the stopped service.
              Has now occurred number times.

              GertjanG 1 Reply Last reply Reply Quote 0
              • GertjanG
                Gertjan @Gerry555
                last edited by

                @Gerry555 said in Kea DHCP stops working:

                Any sign if this issue is road mapped to be been corrected?

                2.8.0 is in the works ...

                @Gerry555 said in Kea DHCP stops working:

                This issue is still occurring on the latest version 24.11

                Maybe ?
                I'm using 24.11.
                I switched to KEA DHCPv4 and DHCPv6, on 4 LAN's, the day 24.11 came out - 3 months now ?
                I use many DHCP MAC/DUID 'static' leases.
                With "host name into DNS registration" (one 1 decade old problem solved !!)
                Kea, for me, is rock solid. I can go on holiday for 10 days, come back, and find everything up and running (company router - lost of leases as it is a hotel with a captive portal).
                Kea didn't crash or something like that.

                And I didn't made live easy on myself, I added 'manually' this ISC DHCP Dynamic DNS feature and Kea DHCP? and still no problem what so ever.

                I'm using a 4100 - maybe that helps 😊

                No "help me" PM's please. Use the forum, the community will thank you.
                Edit : and where are the logs ??

                P 1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  What are you running it on? There does appear to be an upstream issue on armv7 that we have yet to pin down. Currently, since there is no fix, advice is to revert to ISC if you're using a 3100.

                  G 1 Reply Last reply Reply Quote 0
                  • G
                    Gerry555 @stephenw10
                    last edited by

                    Thanks @stephenw10 . Much appreciate the response.

                    Yes - I am using a 3100. I have switched back to ISC.

                    O 1 Reply Last reply Reply Quote 1
                    • O
                      onnastick @Gerry555
                      last edited by

                      I have a 3100 running 24.11 since it came out. I switched over to KEA as well just because I thought that's what the advice was, since ISC is deprecated.

                      However, ever since I made these changes, I have noticed that from time to time, devices stop being able to receive IP assignments. I don't see anything that seems particularly helpful in the system log (though I admit I am only looking at the DHCP log). I haven't tried manually restarting the service, but usually just a power cycle fixes it until it breaks again. Sometimes this is what I have to do if I am not there and am providing remote support to someone less technical.

                      Based on @stephenw10's advice above I have just reverted to ISC and will plan to leave it this way for a while in the hopes it will stop periodically breaking.

                      stephenw10S 1 Reply Last reply Reply Quote 0
                      • stephenw10S
                        stephenw10 Netgate Administrator @onnastick
                        last edited by

                        @onnastick said in Kea DHCP stops working:

                        I switched over to KEA as well just because I thought that's what the advice was, since ISC is deprecated.

                        It was at release. And still is for any other hardware. However this upstream bug has since been discovered in armv7. I'm running it here and haven't yet found any full workaround.

                        1 Reply Last reply Reply Quote 0
                        • P
                          Patch @Gertjan
                          last edited by Patch

                          @Gertjan said in Kea DHCP stops working:

                          2.8.0 is in the works ...

                          LOL
                          The pubic access to daily build has been blocked since late 2023
                          pfsense Community v2.8 is a vaporware product which currently contains the majority of the pfsense redmine changes for the over 16 months through to July 2025

                          Don't hold your breath waiting for it to materialise.

                          1 Reply Last reply Reply Quote 0
                          • M
                            MacUsers
                            last edited by

                            I just experienced the very same issue with Kea, running v24.11 on 8200. The newly added device was getting an IP from the dynamic pool but wasn't able to receive the IP from the static mapping. I restarted Kea service for few times, removed the lock file etc. but nothing worked, until I restartd the box. So, the issue seems to be well present in the latest version as well.

                            1 Reply Last reply Reply Quote 0
                            • stephenw10S
                              stephenw10 Netgate Administrator
                              last edited by

                              So you set a static mapping for a device that had a current dynamic lease but it failed to pull that until pfSense was restarted?

                              M 1 Reply Last reply Reply Quote 0
                              • M
                                MacUsers @stephenw10
                                last edited by MacUsers

                                @stephenw10,
                                yes, exactly. And the strange thing was, that auto-assigned address wasn't being displayed under Status > DHCP Leases. The only way I could see what IP has been assigned was on the device itself.

                                1 Reply Last reply Reply Quote 0
                                • stephenw10S
                                  stephenw10 Netgate Administrator
                                  last edited by

                                  Are you sure the client was requesting a new lease? Or actually pulling one?

                                  M 1 Reply Last reply Reply Quote 0
                                  • M
                                    MacUsers @stephenw10
                                    last edited by

                                    @stephenw10 I can confirm that static mapping for any new device is not working at all, at least for me. in last couple of days, I tried with three difrent devices and once it gets an IP from the dynamic pool, the only way to get the correct IP from the statuc maping is to reboot pfSense.

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      MacUsers
                                      last edited by

                                      slowly thinking again, it's actually happening for me from the day one. It was for a different reasone but I reported here too:

                                      https://forum.netgate.com/topic/196090/pfsense-behind-pfsense-not-getting-wan-ip-from-pfs1/7?_=1739914407057

                                      1 Reply Last reply Reply Quote 0
                                      • stephenw10S
                                        stephenw10 Netgate Administrator
                                        last edited by

                                        What I expect to happen here is the device keeps the dynamic IP lease until it tries to renew it.

                                        If you cleared the leases in pfSense such that Kea doesn't show it at all are you sure it is actually pulling a new lease at all?

                                        M 1 Reply Last reply Reply Quote 0
                                        • M
                                          MacUsers @stephenw10
                                          last edited by

                                          @stephenw10 I forced Renew DHC Lease on my MacBook after giving it a static-dhcp IP in PFS but it was still getting the old dynamic IP. But the strange thing is, that wasn't showing up under the Status >> DHCP Leases at all.

                                          I haven't seen this before and it is happening with even the old devices. I replaced by DIY box with 8200 and upgraded to v24.11 at the same time - all I can say, it started happening after one of the either.

                                          Just to give it a benefit of doubt: how do I chk that device was actually pulling a new lease?

                                          stephenw10S 1 Reply Last reply Reply Quote 0
                                          • M
                                            MacUsers
                                            last edited by

                                            okay, basically nothing is changng/updating related to DHCP. In one of the static-mappings, I provided custom DNS Servers (under the Server Options) and it's still showing the old DNS server address, even after restarting the client device. I'm very sure that it won't change, regardlessly what I do from/on the client side, nothing will change until I reboot the PFS box.

                                            I'll restart and report here back soon.

                                            GertjanG 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.