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

    Restart DHCP Service

    Scheduled Pinned Locked Moved DHCP and DNS
    5 Posts 4 Posters 4.8k 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.
    • U
      unexpectedreboot
      last edited by

      I have an issue with a router I have deployed in a hotel with 12 access points. It's not properly turning over DHCP leases as they expire, so the scope becomes full and new devices can't join the network.

      As a solution I've set a cron to reboot the router every three hours and that's working well but it also causes about 30 seconds of downtime every three hours. Is there a way to restart the dhcpd service instead? I've tried isc-dhcpd restart and service dhcpd restart without any luck.

      • <dhcpd>- <lan><enable>- <range><from>10.11.1.30</from>
          <to>10.11.1.252</to></range>
          <defaultleasetime>10800</defaultleasetime>
          <maxleasetime>86400</maxleasetime>
          <netmask><failover_peerip><gateway><ddnsdomain><next-server><filename></filename></next-server></ddnsdomain></gateway></failover_peerip></netmask></enable></lan></dhcpd>

      Thanks for your help!

      1 Reply Last reply Reply Quote 0
      • P
        phil.davis
        last edited by

        Not directly answering your question - but why do you have the default lease time set to 86400 seconds (24 hours). Maybe that is why you do not see the leases turning over.
        I think the default is 2 hours, and that is likly to be reasonable. Clients that are still running will simply send a request to renew their lease before it expires, thus keeping the same IP address. Clients that are finished will have the lease expire at the end of 2 hours and it can be reused.
        And if you really do have a couple of hundred different devices in a 2 hour period, then expand the subnet and allocate a bigger DHCP range.

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

        1 Reply Last reply Reply Quote 0
        • T
          timthetortoise
          last edited by

          I personally set the default lease on my guest network to an hour. With how many devices come and go, there's no reason to have a lease time much higher. The difference in traffic between that and a 2+ hour lease is negligible.

          1 Reply Last reply Reply Quote 0
          • johnpozJ
            johnpoz LAYER 8 Global Moderator
            last edited by

            While I agree decrease in lease time and or increasing scope for number of ips is better option.  You can restart a service with pfSsh.sh playback svc command servicename

            So example

            [2.1.2-RELEASE][root@pfsense.local.lan]/root(2): pfSsh.php playback svc restart dhcpd

            Starting the pfSense shell system…............

            Attempting to issue restart to dhcpd service...

            dhcpd has been restarted.

            So you could create a cron job for this command if needed..  But it really shouldn't be needed, since leases should expire, etc.

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            1 Reply Last reply Reply Quote 0
            • U
              unexpectedreboot
              last edited by

              I have experimented with different values for lease expiration and settled on a day to try and make it as painless as possible for guests who say check in a 6PM and use their computer the following morning. I was trying to rule out an issue with shorter leases where a single user may be assigned several different addresses thereby consuming multiple addresses over the course of their stay. It seemed like this may have been happening as at any time there may have been 60 devices but yet nearly the entire scope was consumed.

              However, I will change it back to a shorter lease time as I think the real cause of the issue was in the naming of the access points, they had been identical and so guests were jumping between them and I think that was in fact causing the multiple leases to a single device. So now SSID are 1, 2, 3, etc…

              I'll also try setting up a cron with the service reboot, thanks very much.

              Any other suggestions, they are all greatly appreciated.

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