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

DHCP leases status timeout

Scheduled Pinned Locked Moved DHCP and DNS
9 Posts 4 Posters 1.0k 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.
  • E
    eangel
    last edited by Mar 31, 2023, 7:19 AM

    Hi,

    We run a couple of pfSense instances in HA and are having problems with the DHCP leases page. I have seen here that this is not uncommon, but have yet to see a fix for it.
    Our setup has a captive portal serving around 2000 devices. The DHCP addresses are from a /16 subnet. The DHCP leases status page always gives a '504 Gateway Time-out'. I have seen that the dhcp.leases file is huge. Around 4MB. I thought initially that this was because of the sites traffic volume, but it turns out the this is also its initial size. From what I understand the dhcp.leases file is somehow populated when the service is started. Possibly something to do with the load sharing DHCP? This also happens in my lab, which has almost no clients.

    My question is really if it is possible to fix the DHCP leases status page somehow?

    J 1 Reply Last reply Mar 31, 2023, 11:26 AM Reply Quote 0
    • J
      johnpoz LAYER 8 Global Moderator @eangel
      last edited by Mar 31, 2023, 11:26 AM

      @eangel what version are you running - sounds like this

      https://redmine.pfsense.org/issues/11512

      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
      • E
        eangel
        last edited by Mar 31, 2023, 5:01 PM

        @johnpoz I think you may be right, but I don't quite understand how to fix it. I see mention of a patch, but the bug 2 years old. Shouldn't the fix be included by now?

        I'm running 2.6

        J 1 Reply Last reply Mar 31, 2023, 5:09 PM Reply Quote 0
        • J
          johnpoz LAYER 8 Global Moderator @eangel
          last edited by johnpoz Mar 31, 2023, 5:10 PM Mar 31, 2023, 5:09 PM

          @eangel I never ran into this because I point to dns that can resolve my clients via PTR, etc. I believe the root of the problem is time out because just can not resolve the IPs via PTR, or huge delays trying to when your using external dns and timeouts for say rfc1918 IPs, etc.

          I think there was mention of regression. What version are you using?

          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
          • E
            eangel
            last edited by Mar 31, 2023, 9:21 PM

            I'm on 2.6

            I do see that there may be a problem with DNS as the whole network is behind a rather slow link. I just wish it would work the way it used to. I saw a mention of commenting out the line that does the resolving in the php script. Maybe I'll try that.

            Thanks for helping by the way!

            J 1 Reply Last reply Mar 31, 2023, 9:24 PM Reply Quote 0
            • J
              johnpoz LAYER 8 Global Moderator @eangel
              last edited by johnpoz Mar 31, 2023, 9:25 PM Mar 31, 2023, 9:24 PM

              @eangel said in DHCP leases status timeout:

              behind a rather slow link

              Not sure why that should matter lookup a ptr for say 192.168.1.42 ? That should be your local dns, so be it your internet connection is 128k or 1gig that wouldn't matter.

              Your never going to resolve rfc1918 IPs via say googledns.. Do you not have pfsense pointing to 127.0.0.1 first for dns? What can resolve your local IPs?

              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
              • G
                Gertjan
                last edited by Gertjan Apr 4, 2023, 7:35 AM Apr 4, 2023, 7:29 AM

                @eangel said in DHCP leases status timeout:

                I saw a mention of commenting out the line that does the resolving in the php script. Maybe I'll try that.

                Try this first : Repair your DNS 😊

                Run a test like this :

                [23.01-RELEASE][admin@pfsense.mylocalnetwork.net]/etc: host 192.168.1.2
                2.1.168.192.in-addr.arpa domain name pointer bureau2.mylocalnetwork.net.
                

                192.168.1.2 is a known device on my network. It has a (static) DHCP lease, so it's know to the local DNS.

                I can see it :
                [23.01-RELEASE][admin@pfSense.mylocalnetwork.net]/root: cat /etc/hosts
                127.0.0.1 localhost localhost.mylocalnetwork.net
                ::1 localhost localhost.mylocalnetwork.net
                192.168.1.1 pfSense.mylocalnetwork.net pfSense
                2a01:cb:dead:19:907:a6dc::1 pfSense.mylocalnetwork.net pfSense
                192.168.1.2 bureau2.mylocalnetwork.net bureau2
                .....

                Another test :

                [23.01-RELEASE][admin@pfSense.mylocalnetwork.net]/root: dig @127.0.0.1 -x 192.168.1.2 +short
                bureau2.mylocalnetwork.net.
                

                'dig' is using localhost or 127.0.0.1, on port 53, and it asks : what is the host name of the device using "192.168.1.2".
                This is a so called DNS reverse request : with a given IP, get the host name.
                Normally, a host name is given, , like "facebook.com" and the IP is requested.
                There should be an answer.

                If I was asking for a device with an unused IP on my network :

                [23.01-RELEASE][admin@pfSense.mylocalnetwork.net.]/root: dig @127.0.0.1 -x 192.168.1.200 +short
                

                then I'll receive an answer in micro seconds : no host name known so nothing is shown.

                If the resolver (unbound, or for that matter : the forwarder if you used that one) wasn't listening on 127.0.0.1 port 53 (UDP and/or TCP) then the requests will take ages before it times out.

                So : is there some one at 127.0.0.1 port 53 ?
                By any change, isn't is, for example, restarting all the time (another very known subject) ?

                Btw :

                This PHP function :

                80e5c7f1-e2a1-46dc-b5c9-3a5853092b79-image.png

                7d45fb43-0ed4-461d-90c7-251c9e896844-image.png

                is a wrapper around the identical command line command :

                host X
                

                where X is an IP address.
                It winds up talking to 127.0.0.1 port 53.
                If no one is there, then, yeap, you'll be facing big time outs.
                If you have many leases, the entire web page (DHCP leases page) will eventually time out = web server gateway error.

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

                E 1 Reply Last reply Apr 4, 2023, 1:54 PM Reply Quote 0
                • E
                  eangel @Gertjan
                  last edited by Apr 4, 2023, 1:54 PM

                  @gertjan Dam! You are correct!
                  I had not selected 'localhost' in the list of interfaces to serve with the DNS forwarder. Once I did that and told it not to forward private addresses, the leases status page appears quickly.

                  Thank you very much for the excellent reply!

                  1 Reply Last reply Reply Quote 0
                  • R
                    rvjr
                    last edited by Mar 12, 2025, 3:36 PM

                    Wow, thanks guys! This helped me get my DHCP leases page working again. I also had reverse lookups redirected to the domain controller DNS via 'Domain Overrides' on the DNS resolver page. Somehow that did time out. I remove the overrides, and now everything works smoothly. Now I just have to figure out how to repair the overrides, or whether I need the reverse lookups for Active Directory at all. Because they obviously didn't work for a while now, and I didn't see any issues so far...

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                      [[user:consent.lead]]
                      [[user:consent.not_received]]