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

DHCP lease screen not loading

DHCP and DNS
30
123
52.4k
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.
  • K
    krinn
    last edited by Apr 14, 2021, 10:52 AM

    Still Facing the issue after upgrade to 2.5.1, tried clearing the dhcp leases file and still the problem persist, able to view the dhcp leases through command prompt but GUI is not available. It would be very helpful if the someone who has sorted this issue can help.

    G 1 Reply Last reply Apr 15, 2021, 8:09 AM Reply Quote 0
    • G
      Gertjan @krinn
      last edited by Gertjan Apr 15, 2021, 8:11 AM Apr 15, 2021, 8:09 AM

      @krinn said in DHCP lease screen not loading:

      tried clearing the dhcp leases file and still the problem persist, able to view the dhcp leases through command prompt but GUI is not available.

      What does show up when you visit that page ?

      "Status > DHCP Leases" or https://............/status_dhcp_leases.php

      Go to your browser dev mode ( Firefox : Ctrl-Shift - i and then select Network - and hit F5 )

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

      D 1 Reply Last reply Apr 15, 2021, 6:40 PM Reply Quote 0
      • D
        DrQuinn24 @Gertjan
        last edited by Apr 15, 2021, 6:40 PM

        @gertjan Here is what is seen when using the instruction for Firefox when choosing Status/DHCP leases:login-to-view

        I have had the same issue since upgrading to 2.5 ( currently on 2.5.1). The only major change prior to 2.5 that I can recall on my system was installing the NextDNS cli.

        C 1 Reply Last reply Apr 15, 2021, 6:43 PM Reply Quote 0
        • C
          chance @DrQuinn24
          last edited by Apr 15, 2021, 6:43 PM

          @drquinn24 It's timing out just like it was for everyone above. the solution is to delete your leases database and restart the dhcp service. That "solves" the problem for an undetermined amount of time, but at the cost of you now don't know what leases are out.

          Nothing in 2.5.1 is related to this issue, and I'm not even sure it's going to be a priority for netgate anytime soon.

          K 1 Reply Last reply Apr 16, 2021, 3:49 AM Reply Quote 0
          • K
            karlfife @chance
            last edited by karlfife Apr 16, 2021, 4:01 AM Apr 16, 2021, 3:49 AM

            @chance
            Has anyone reported this as a bug?

            This problem appears to be a function of how many entries are in the dhcp.leases file which DO NOT contain a client-hostname field. MANY offending entries may cause a delay long enough to create a timeout condition.

            Reproducable like this:

            With zero entries in the dhcp.leases file, on my hardware it takes LESS THAN one second to load the dhcp leases page. Note that my page also renders 36 additional static mappings, even with an empty leases file.

            The following entry appears in my dhcp.leases file after some period of time.

            lease 10.179.11.33 {
              starts 5 2021/04/16 02:21:58;
              ends 5 2021/04/16 04:21:58;
              tstp 5 2021/04/16 04:21:58;
              cltt 5 2021/04/16 02:21:58;
              binding state active;
              next binding state free;
              rewind binding state free;
              hardware ethernet e8:4e:06:7a:b1:e2;
              set vendor-class-identifier = "android-dhcp-10";
              client-hostname "Atari5200";
            }
            

            Page load time is still under 1 sec. After some time, the next entry appears in dhcp.leases. Note that the new one has no name!

            lease 10.179.11.70 {
              starts 5 2021/04/16 02:44:01;
              ends 5 2021/04/16 04:44:01;
              tstp 5 2021/04/16 04:44:01;
              cltt 5 2021/04/16 02:44:01;
              binding state active;
              next binding state free;
              rewind binding state free;
              hardware ethernet 34:af:b3:c5:f2:d2;
              set vendor-class-identifier = "android-dhcp-9";
            }
            

            In this state, on my specific hardware, it takes about 6 seconds to load the dhcp leases page. I'm suggesting that the second entry is causing the problem. To fix the issue, open the dhcp.leases file in vi, and add the following line to the second lease.

              client-hostname "Commodore64-10GBase-LR";
            

            If you figure out how to save/exit from vi, the file looks like this:

            lease 10.179.11.33 {
              starts 5 2021/04/16 02:21:58;
              ends 5 2021/04/16 04:21:58;
              tstp 5 2021/04/16 04:21:58;
              cltt 5 2021/04/16 02:21:58;
              binding state active;
              next binding state free;
              rewind binding state free;
              hardware ethernet e8:4e:06:7a:b1:e2;
              set vendor-class-identifier = "android-dhcp-10";
              client-hostname "Atari5200";
            }
            lease 10.179.11.70 {
              starts 5 2021/04/16 02:44:01;
              ends 5 2021/04/16 04:44:01;
              tstp 5 2021/04/16 04:44:01;
              cltt 5 2021/04/16 02:44:01;
              binding state active;
              next binding state free;
              rewind binding state free;
              hardware ethernet 34:af:b3:c5:f2:d2;
              set vendor-class-identifier = "android-dhcp-9";
              client-hostname "Commodore64-10GBase-LR";
            }
            

            Without doing anything else (no confounding dhcp service restarts etc.) the dhcp leases page again loads in under 1 second.

            I have tested other variations of this test involving an increased number of rogue unnamed entries. More rogue entries appears to cause longer page load times. In every case, opening the dhcp.leases file in vi, and assigning the rogue entries a name appears to eliminate the page load delays all of the time.

            If others can reproduce this, I wills file a bug report.

            G 1 Reply Last reply Apr 16, 2021, 7:31 AM Reply Quote 1
            • G
              Gertjan @karlfife
              last edited by Apr 16, 2021, 7:31 AM

              Great write-up.
              This is what is needed to find the issue.

              I just looked am my /var/dhcpd/var/db/dhcpd.leases file.
              About 72 Kbytes - 196 leases, and (only) 19 leases have a "client-hostname".
              177 lease entries have no client-hostname at all.
              Still : I never had any issues looking at Status > DHCP leases.

              So, is it ok to think that the presence of absence of a "client-hostname" line in a lease is not the issue ?

              This file : /usr/local/www/status_dhcp_leases.php

              When you place a // in front line 91, like this :

              // $leases = system_get_dhcpleases();
              

              ( do the same thing for the next line 95 - just to be sure )

              Status >> DHCP should show an empty page like this :

              login-to-view

              If still nothing shows up, the issue is not "DHCP" related at all.

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

              1 Reply Last reply Reply Quote 0
              • C
                chance
                last edited by chance Apr 16, 2021, 1:09 PM Apr 16, 2021, 12:52 PM

                I've not reported this, I've actually abandoned ship after 2.5.0 gave me fits with IPSec and GRE tunnels.

                I'm glad you guys are making progress though.

                I would recommend going to the spot where system_get_dhcpleases() is and find the DNS lookup lines. Add an IF the hostname is null (in php obviously) then skip it.

                That should solve the issue.

                I checked in the source on github and this is the file.

                https://github.com/pfsense/pfsense/blob/0f03681f9b16583ac0f6a6b98272ab9b2d11d79e/src/etc/inc/system.inc#L675

                It's already checking for empty, so I assume it's getting a false positive. (or maybe it's not the current version.)

                I think it should be something like this:

                if (preg_match('/}$/', $line)) {
                			if ($lease) {
                				if (empty($item['hostname'])) {
                					$hostname = gethostbyaddr($item['ip']);
                					if (!empty($hostname) &$ empty($hostname) != "") {
                						$item['hostname'] = $hostname;
                					}
                				}
                				$leases['lease'][] = $item;
                				$lease = false;
                				$dedup_lease = true;
                			} else if ($failover) {
                				$leases['failover'][] = $item;
                				$failover = false;
                				$dedup_failover = true;
                			}
                			continue;
                		}
                

                Relevant line I added (&& $hostname != "")
                if (!empty($hostname) && $hostname != "") {

                No idea if it will work or not.

                Nevermind, just comment out the gethostbyaddr line and live without it I guess...

                K G 2 Replies Last reply Apr 16, 2021, 11:05 PM Reply Quote 0
                • K
                  karlfife @chance
                  last edited by karlfife Apr 16, 2021, 11:15 PM Apr 16, 2021, 11:05 PM

                  @chance
                  I believe this is covered in this bug report:
                  https://redmine.pfsense.org/issues/11512

                  Parallel discussion can be found here:
                  https://forum.netgate.com/topic/161121/after-upgrade-to-2-5-status_dhcp_leases-php-nor-diag_arp-php-will-load/13

                  1 Reply Last reply Reply Quote 0
                  • Z
                    zarteg @pette_rsson
                    last edited by zarteg May 4, 2021, 9:29 PM May 4, 2021, 9:00 PM

                    Turns out I had the same issue.
                    Kill your DNS Resolver and try again.

                    1 Reply Last reply Reply Quote 0
                    • G
                      Gertjan @chance
                      last edited by Gertjan May 5, 2021, 7:20 AM May 5, 2021, 7:14 AM

                      @chance said in DHCP lease screen not loading:

                      Nevermind, just comment out the gethostbyaddr line and live without it I guess...

                      The definition of gethostbyaddr is https://www.php.net/manual/fr/function.gethostbyaddr.php

                      Look somewhat down n on that page, you find :

                      The problem of broken DNS servers.....

                      So is this a 'broken DNS issue' after all ?

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

                      1 Reply Last reply Reply Quote 0
                      • D
                        drumnbisco
                        last edited by May 5, 2021, 1:00 PM

                        Can confirm, had my primary dns set to 9.9.9.9 for dnssec, switched it to googles and clicked save, dhcp leases status page loaded fine. Switched it back and pages loads fine a 2nd time.

                        G 1 Reply Last reply May 5, 2021, 1:20 PM Reply Quote 0
                        • G
                          Gertjan @drumnbisco
                          last edited by May 5, 2021, 1:20 PM

                          @drumnbisco said in DHCP lease screen not loading:

                          had my primary dns set to 9.9.9.9

                          That means you're forwarding.
                          When forwarding, DNSSEC is meaningless.
                          Stop forwarding, and "dhcp leases status page" loads fine right out of the box.

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

                          D 1 Reply Last reply May 5, 2021, 8:28 PM Reply Quote 0
                          • D
                            drumnbisco @Gertjan
                            last edited by drumnbisco May 5, 2021, 8:28 PM May 5, 2021, 8:28 PM

                            @gertjan
                            I never had an issue loading the DHCP leases page on the previous version. This only happened after I upgraded.

                            I followed this guide https://linuxincluded.com/configuring-quad9-on-pfsense/ which recommended having it checked.

                            G 1 Reply Last reply May 6, 2021, 8:17 AM Reply Quote 0
                            • G
                              Gertjan @drumnbisco
                              last edited by May 6, 2021, 8:17 AM

                              @drumnbisco said in DHCP lease screen not loading:

                              This only happened after I upgraded.

                              Most probably, the upgrade just exposed an issue : pfSense itself has no DNS any more.
                              This situation is often experiences by users that have no LAN issues (DNS issues for LAN clients) but wonder why pfSense doesn't propose updates any more.

                              No working DNS for pfSense itself also means that the DHCP status generation page doesn't work any more, as every DNS request fails after 'many seconds'. If you have many DHCP leases, the page construction will takes minutes, or far more : the page takes forever to get generated, the browser or web server will finally bail out.

                              Yet another good reason NOT to forward or NOT to change any DNS settings.
                              Because the ones with default DNS settings do never experience " DHCP status page' " issues.
                              And if you forward : ok, but be ready to do some testing every time there is an issue. Even if the issue doesn't seem to be DNS related.
                              Like : can I load and update the list with proposed pfSense packages ?
                              Is this

                              login-to-view

                              actual ?

                              check system logs.
                              check DNS logs.

                              I've just checked this myself :
                              I 'killed' unbound by pressing :

                              login-to-view

                              Then I visited the Status DHCP Leases page.
                              It wouldn't load any more - that is : it loads partially. The "wheel" kept on spinning turning for minutes .....
                              When I started unbound, the page loaded instantly.

                              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 May 6, 2021, 2:20 PM Reply Quote 0
                              • P
                                plague311 @Gertjan
                                last edited by plague311 May 6, 2021, 2:21 PM May 6, 2021, 2:20 PM

                                @gertjan said in DHCP lease screen not loading:

                                @drumnbisco said in DHCP lease screen not loading:

                                This only happened after I upgraded.

                                Most probably, the upgrade just exposed an issue : pfSense itself has no DNS any more.
                                This situation is often experiences by users that have no LAN issues (DNS issues for LAN clients) but wonder why pfSense doesn't propose updates any more.

                                No working DNS for pfSense itself also means that the DHCP status generation page doesn't work any more, as every DNS request fails after 'many seconds'. If you have many DHCP leases, the page construction will takes minutes, or far more : the page takes forever to get generated, the browser or web server will finally bail out.

                                Yet another good reason NOT to forward or NOT to change any DNS settings.
                                Because the ones with default DNS settings do never experience " DHCP status page' " issues.
                                And if you forward : ok, but be ready to do some testing every time there is an issue. Even if the issue doesn't seem to be DNS related.
                                Like : can I load and update the list with proposed pfSense packages ?
                                Is this

                                login-to-view

                                actual ?

                                check system logs.
                                check DNS logs.

                                I've just checked this myself :
                                I 'killed' unbound by pressing :

                                login-to-view

                                Then I visited the Status DHCP Leases page.
                                It wouldn't load any more - that is : it loads partially. The "wheel" kept on spinning turning for minutes .....
                                When I started unbound, the page loaded instantly.

                                I'm not really sure what most of this means, mind you I'm a network\systems administrator that has a degree in this, but this doesn't make a lot of sense.

                                In my situation, which I believe is much like drumnbisco's issue, there was never an issue with DNS. I was able to get the proposed upgrade button, that's how I upgraded to 2.5 in the first place. The button continued to work as that's how I got upgraded to 2.5.1 while having issues with the DHCP screen. The two weren't connected at all. My pfsense handles DHCP (still) but hands out a DNS to the PiHole, which then handles all of the requests. That configuration is what I've used at my house for over a year or 2, since I installed the PiHole.

                                I'm not sure this is related to the issue anyone here is seeing.

                                G 1 Reply Last reply May 6, 2021, 2:34 PM Reply Quote 0
                                • G
                                  Gertjan @plague311
                                  last edited by May 6, 2021, 2:34 PM

                                  @plague311
                                  Ah, didn't know about the PiHole ...

                                  I rephrase my last (above) post :
                                  Stop the DNS - unbound on pfSense, or your PiHole, and you see that the the DHCP lease page doesn't show up any more : it won't come to completion.
                                  Because it can't 'resolve' host names any more. And that would explain the issue.

                                  You can check easily if 'DNS' is the explication of your issue : "DHCP Lease page not loading " :
                                  Disable line https://github.com/pfsense/pfsense/blob/f528b6a9cba18d7f299fdeed8c84f22abb16fcf1/src/etc/inc/system.inc#L742 by putting a
                                  //
                                  in front of the line.

                                  Or make it look like

                                  /* $hostname = gethostbyaddr($item['ip']); */
                                  

                                  if the issue is gone, you know that the issue is that pfSense has no access to a 'DNS'.

                                  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 May 6, 2021, 3:10 PM Reply Quote 0
                                  • P
                                    plague311 @Gertjan
                                    last edited by May 6, 2021, 3:10 PM

                                    @gertjan My issue is already resolved with whatever netgate did with 2.5.1. My DHCP leases screen works without issue now. I didn't have to change anything. Just updated and it started working again.

                                    K 1 Reply Last reply May 6, 2021, 6:27 PM Reply Quote 0
                                    • K
                                      karlfife @plague311
                                      last edited by karlfife May 6, 2021, 6:28 PM May 6, 2021, 6:27 PM

                                      @plague311
                                      Incorrect. v2.5.1 did not resolve the problem.
                                      The upgrade temporarily masks the problem.

                                      P 1 Reply Last reply May 7, 2021, 1:38 PM Reply Quote 0
                                      • P
                                        plague311 @karlfife
                                        last edited by May 7, 2021, 1:38 PM

                                        @karlfife Oh that might be. It's been slow, but worked the few times I've needed to use it. Admittedly I use pfsense on a VM at my home. It doesn't get a lot of attention since I built it. One of those set it and forget it type of things. Every few weeks I check for updates, that's about it.

                                        1 Reply Last reply Reply Quote 0
                                        • M
                                          maraun
                                          last edited by May 18, 2021, 7:44 AM

                                          I found the error :-)
                                          The timeout comes by /etc/inc/system.inc
                                          line 735 $hostname = gethostbyaddr($item['ip']);

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