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

Unbound DHCP registration checkbox bug?

Scheduled Pinned Locked Moved webGUI
25 Posts 4 Posters 3.2k 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
    Ender117 @Gertjan
    last edited by Ender117 Sep 10, 2018, 5:50 PM Sep 10, 2018, 5:49 PM

    @gertjan
    Thanks for the insight, though changing/saving DHCP setting didn't do anything for me. I will go check the process you mentioned when I got home.

    I thought that when you uncheck "DHCP registration" it would comment out

    include: /var/unbound/dhcpleases_entries.conf
    

    that was the most intuitive to me.

    1 Reply Last reply Reply Quote 0
    • E
      Ender117
      last edited by Sep 13, 2018, 12:40 AM

      So I sshed in and rm the files, that fixed the problem. But if I check these boxes and then uncheck, the problem comes back. looks like a GUI bug to me

      1 Reply Last reply Reply Quote 0
      • R
        RonpfS
        last edited by Sep 13, 2018, 12:42 AM

        The line is present with the box unchecked
        The file dhcpleases_entries.conf should be empty when it's unchecked.

        2.4.5-RELEASE-p1 (amd64)
        Intel Core2 Quad CPU Q8400 @ 2.66GHz 8GB
        Backup 0.5_5, Bandwidthd 0.7.4_4, Cron 0.3.7_5, pfBlockerNG-devel 3.0.0_16, Status_Traffic_Totals 2.3.1_1, System_Patches 1.2_5

        E 1 Reply Last reply Sep 13, 2018, 12:45 AM Reply Quote 0
        • E
          Ender117 @RonpfS
          last edited by Ender117 Sep 13, 2018, 12:45 AM Sep 13, 2018, 12:45 AM

          @ronpfs
          yeah but look at my post above, what's in /var/unbound/dhcpleases_entries.conf remains unchanged with the box checked or unchecked. At least for me

          R 1 Reply Last reply Sep 13, 2018, 12:48 AM Reply Quote 0
          • R
            RonpfS @Ender117
            last edited by Sep 13, 2018, 12:48 AM

            @ender117 Did you check the box, save, uncheck the box save.
            Both Unbound and DHCP server should restart when you save.

            Do the same with DHCP Server settings.

            2.4.5-RELEASE-p1 (amd64)
            Intel Core2 Quad CPU Q8400 @ 2.66GHz 8GB
            Backup 0.5_5, Bandwidthd 0.7.4_4, Cron 0.3.7_5, pfBlockerNG-devel 3.0.0_16, Status_Traffic_Totals 2.3.1_1, System_Patches 1.2_5

            E 1 Reply Last reply Sep 13, 2018, 12:57 AM Reply Quote 0
            • E
              Ender117 @RonpfS
              last edited by Sep 13, 2018, 12:57 AM

              @ronpfs Yes I did saved and applied changes. DHCP server setting only allow me to save though

              R 1 Reply Last reply Sep 13, 2018, 1:01 AM Reply Quote 0
              • R
                RonpfS @Ender117
                last edited by Sep 13, 2018, 1:01 AM

                @ender117 Well have a look at the System Log to see if the services restart.

                You can restart DHCP server from the Status / Services tab.

                2.4.5-RELEASE-p1 (amd64)
                Intel Core2 Quad CPU Q8400 @ 2.66GHz 8GB
                Backup 0.5_5, Bandwidthd 0.7.4_4, Cron 0.3.7_5, pfBlockerNG-devel 3.0.0_16, Status_Traffic_Totals 2.3.1_1, System_Patches 1.2_5

                E 1 Reply Last reply Sep 13, 2018, 1:13 AM Reply Quote 0
                • E
                  Ender117 @RonpfS
                  last edited by Sep 13, 2018, 1:13 AM

                  @ronpfs restarted DHCP service while the box unchecked. Didn't clear that file as it suppose to

                  R 1 Reply Last reply Sep 13, 2018, 4:57 AM Reply Quote 0
                  • R
                    RonpfS @Ender117
                    last edited by RonpfS Sep 13, 2018, 4:57 AM Sep 13, 2018, 4:57 AM

                    @ender117 Maybe it's time to provide more info about you pfsense box: version, hardware, packages, etc

                    2.4.5-RELEASE-p1 (amd64)
                    Intel Core2 Quad CPU Q8400 @ 2.66GHz 8GB
                    Backup 0.5_5, Bandwidthd 0.7.4_4, Cron 0.3.7_5, pfBlockerNG-devel 3.0.0_16, Status_Traffic_Totals 2.3.1_1, System_Patches 1.2_5

                    G 1 Reply Last reply Sep 13, 2018, 9:06 AM Reply Quote 0
                    • G
                      Gertjan @RonpfS
                      last edited by Gertjan Sep 19, 2018, 6:17 AM Sep 13, 2018, 9:06 AM

                      @ronpfs said in Unbound DHCP registration checkbox bug?:

                      @Ender117 ender117 Maybe it's time to provide more info about you pfsense box: version, hardware, packages, etc

                      What @Ender117 sees, is what I see. Its part of pfSense current (2.4.3_1) behavior.
                      Installed packages, or not, the issue is the same (except if packages start to modify system files like /etc/inc/system.inc etc).

                      What happens can be seen here : function system_dhcpleases_configure() in /etc/inc/system.inc :
                      https://github.com/pfsense/pfsense/blob/7c15c19d76eac725c42133012488cb97e4dcd885/src/etc/inc/system.inc#L572

                      First, the main issue :

                      0_1536816313441_755e8c98-12d2-4b03-bea0-c36e89ab2315-image.png

                      My "DHCP Registration" is not checked.
                      Still, my unbound config file will include this file /var/unbound/dhcpleases_entries.conf, which contains leases - this is ok : but it should be empty in this case. And that's NOT the case.

                      # dhcpleases automatically entered
                      local-data: "iPhonevhristine.brit-hotel-fumel.net IN A 192.168.2.34"
                      local-data-ptr: "192.168.2.34 iPhonevhristine.brit-hotel-fumel.net"
                      local-data: "MBP-de-manu.brit-hotel-fumel.net IN A 192.168.2.162"
                      local-data-ptr: "192.168.2.162 MBP-de-manu.brit-hotel-fumel.net"
                      local-data: "iPhone-de-Julie.brit-hotel-fumel.net IN A 192.168.2.196"
                      local-data-ptr: "192.168.2.196 iPhone-de-Julie.brit-hotel-fumel.net"
                      local-data: "iPaddeVeronique.brit-hotel-fumel.net IN A 192.168.2.131"
                      local-data-ptr: "192.168.2.131 iPaddeVeronique.brit-hotel-fumel.net"
                      local-data: "android-b094ac578001045c.brit-hotel-fumel.net IN A 192.168.2.18"
                      local-data-ptr: "192.168.2.18 android-b094ac578001045c.brit-hotel-fumel.net"
                      local-data: "PO130022159.brit-hotel-fumel.net IN A 192.168.2.64"
                      local-data-ptr: "192.168.2.64 PO130022159.brit-hotel-fumel.net"
                      local-data: "Galaxy-S9.brit-hotel-fumel.net IN A 192.168.2.35"
                      local-data-ptr: "192.168.2.35 Galaxy-S9.brit-hotel-fumel.net"
                      local-data: "android-fdd7cf6422a374a4.brit-hotel-fumel.net IN A 192.168.2.88"
                      local-data-ptr: "192.168.2.88 android-fdd7cf6422a374a4.brit-hotel-fumel.net"
                      local-data: "Galaxy-Tab-S2.brit-hotel-fumel.net IN A 192.168.2.71"
                      local-data-ptr: "192.168.2.71 Galaxy-Tab-S2.brit-hotel-fumel.net"
                      

                      Why ?

                      It all happens on a day, when we decided to check "DHCP Registration" and Save :

                      0_1536816745444_59c5db87-1f3b-4160-8d3b-842916e51140-image.png

                      The file /var/unbound/dhcpleases_etries.conf will get created, and a process called "dhcpleases" is started that syncs new incoming leases from the DHCP server into our /var/unbound/dhcpleases_etries.conf file- and when this happens, unbound (or the Forwarder) is restarted to take changes into account and all life happy together.

                      Maybe "DHCP Registration" for the Resolver and Forwarder are checked by default, when we installed pfSense ?

                      Now, the interesting part. we uncheck "DHCP Registration" - and Save + Apply.
                      The function system_dhcpleases_configure() doesn't do much anymore. The file /var/unbound/dhcpleases_entries.conf stays in place with our leases that existed at the moment "DHCP Registration" was unchecked. The file is not maintained by nothing anymore.
                      Forwarder or Resolver continues including and using the content. And this is (seems ,) wrong.

                      Or, and here it is :
                      If "DHCP Registration" is unchecked,, /var/unbound/dhcpleases_entries.conf should be flushed.
                      That's it.

                      I'm running this code now :

                      At the end of the function system_dhcpleases_configure()

                      } else if (isvalidpid($pidfile)) {
                      		sigkillbypid($pidfile, "TERM");
                      		@unlink($pidfile);
                      		}
                      	} 
                      }
                      

                      I put in place :

                      } else if (isvalidpid($pidfile)) {
                      		sigkillbypid($pidfile, "TERM");
                      		@unlink($pidfile);
                      		}
                      	} else {
                      		if ((isset($config['dnsmasq']['enable']) && !isset($config['dnsmasq']['regdhcp'])) ||
                      			(isset($config['unbound']['enable']) && !isset($config['unbound']['regdhcp']))) {
                      				mwexec("truncate -s 0 {$g['unbound_chroot_path']}/dhcpleases_entries.conf");
                      		}
                      	}
                      }
                      

                      edit 2018-09-19 : same / simpler / better :

                      	} else {
                      		if (isvalidpid($pidfile)) {
                      				sigkillbypid($pidfile, "TERM");
                      				@unlink($pidfile);
                      			}
                      		if (file_exists("{$g['unbound_chroot_path']}/dhcpleases_entries.conf"))
                      			mwexec("truncate -s 0 {$g['unbound_chroot_path']}/dhcpleases_entries.conf");
                      	}	
                      }
                      

                      => If running, kills the dhcpleases process.
                      => Truncates (empties) the dhcpleases_entries.conf file

                      Now, when "DHCP Registration" is unchecked the file /var/unbound/dhcpleases_entries.conf exist (has to exist) and is empty.

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

                      E 2 Replies Last reply Sep 13, 2018, 6:07 PM Reply Quote 0
                      • E
                        Ender117 @Gertjan
                        last edited by Sep 13, 2018, 6:07 PM

                        @gertjan Ahhh, glad to see someone else had looked at the same problem. And thanks for describe the problem more thoroughly and provide a solution.

                        Do you know if there was a bug report for this? Would be nice if your solution goes official.

                        1 Reply Last reply Reply Quote 0
                        • E
                          Ender117 @Gertjan
                          last edited by Sep 14, 2018, 3:55 PM

                          @gertjan If you don't have time for a bug report, would you mind me go ahead to file one and quote you there?

                          R 1 Reply Last reply Sep 14, 2018, 5:15 PM Reply Quote 0
                          • R
                            RonpfS @Ender117
                            last edited by Sep 14, 2018, 5:15 PM

                            @ender117 Why don't you empty /var/unbound/dhcpleases_entries.conf for now ?

                            You can do that in Diagnostics / Edit File or run a in shell prompt :

                            /usr/bin/truncate -s 0 /var/unbound/dhcpleases_entries.conf
                            

                            2.4.5-RELEASE-p1 (amd64)
                            Intel Core2 Quad CPU Q8400 @ 2.66GHz 8GB
                            Backup 0.5_5, Bandwidthd 0.7.4_4, Cron 0.3.7_5, pfBlockerNG-devel 3.0.0_16, Status_Traffic_Totals 2.3.1_1, System_Patches 1.2_5

                            E 1 Reply Last reply Sep 14, 2018, 5:34 PM Reply Quote 0
                            • E
                              Ender117 @RonpfS
                              last edited by Sep 14, 2018, 5:34 PM

                              @ronpfs I had already fixed the problem manually, but thanks for your kind suggestion anyway. I just believe this is a bug and would like to let the developers know.

                              G 1 Reply Last reply Sep 14, 2018, 6:14 PM Reply Quote 0
                              • G
                                Gertjan @Ender117
                                last edited by Sep 14, 2018, 6:14 PM

                                @ender117
                                I agree, but I prefer not to add new bug right now. They are finalizing 2.4.4.
                                I still need to check if it isn't possible to propose another solution - and if this solution doesn't provoke unwanted side-effect.
                                I hope you agree with me that this is a minor problem (now it solved).

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

                                E 3 Replies Last reply Sep 16, 2018, 4:04 AM Reply Quote 0
                                • E
                                  Ender117 @Gertjan
                                  last edited by Sep 16, 2018, 4:04 AM

                                  @gertjan

                                  Yeah I guess you are right. I would be better to let them finish 2.4.4 first, which I heard that first RC should be out next week. Maybe it will get fix then, who knows.

                                  1 Reply Last reply Reply Quote 0
                                  • E
                                    Ender117 @Gertjan
                                    last edited by Sep 25, 2018, 3:08 AM

                                    @gertjan The official 2.4.4 is out and this bug persists. Guess I will go file a bug report soon

                                    1 Reply Last reply Reply Quote 0
                                    • E
                                      Ender117 @Gertjan
                                      last edited by Oct 1, 2018, 2:47 AM

                                      @gertjan I submitted a bug report: https://redmine.pfsense.org/issues/8981

                                      1 Reply Last reply Reply Quote 0
                                      • luckman212L
                                        luckman212 LAYER 8
                                        last edited by luckman212 Apr 3, 2021, 2:57 AM Jun 25, 2020, 6:47 PM

                                        I hit this one today... made a comment over here:
                                        https://forum.netgate.com/post/920791

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