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

    DHCP-Server not handing out leases, "please make sure no other dhcp server is running..."

    Scheduled Pinned Locked Moved DHCP and DNS
    10 Posts 3 Posters 2.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.
    • B
      BenDroid
      last edited by

      Hi everybody,

      So I set up my new E200-9A system with the latest 2.4.4-DEVELOPMENT (2.4.4.a.20180601.0821 to be axact) version pfsense. I have everything configured like I want. There's only one thing bugging me. The DHCP-Server is not handing out leases. I usually have a Server 2012r2 running a DHCP-Server, but I shut that one off, before I turn on the pfsense dhcp-servcer. In the pfsense dhcp-log it says

      Jun 2 22:55:08	dhcpd		Can't bind to dhcp address: Address already in use
      Jun 2 22:55:08	dhcpd		Please make sure there is no other dhcp server
      Jun 2 22:55:08	dhcpd		running and that there's no entry for dhcp or
      Jun 2 22:55:08	dhcpd		bootp in /etc/inetd.conf. Also make sure you
      Jun 2 22:55:08	dhcpd		are not running HP JetAdmin software, which
      Jun 2 22:55:08	dhcpd		includes a bootp server.
      Jun 2 22:55:08	dhcpd		If you think you have received this message due to a bug rather
      Jun 2 22:55:08	dhcpd		than a configuration issue please read the section on submitting
      Jun 2 22:55:08	dhcpd		bugs on either our web page at www.isc.org or in the README file
      Jun 2 22:55:08	dhcpd		before submitting a bug. These pages explain the proper
      Jun 2 22:55:08	dhcpd		process and the information we find helpful for debugging.
      Jun 2 22:55:08	dhcpd		exiting.
      

      How do I tell the service that the other DHCP-Server isn't running anymore?

      Thanks in advance,
      Ben

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

        Hi,

        Try this : kill them all - and restart (the) one !
        The message doesn't mean some other DHCP server is running on your LAN, but some other dhcp server is running on your pfSense box.
        The issue is this : " Can't bind to dhcp address: Address already in use " which means another process is already bound to "0.0.0.0" port 67.

        Run :

        [2.4.3-RELEASE][admin@pfsense.brit-hotel-fumel.net]/root: ps ax | grep dhcp
        

        You should see :

        23027  -  Ss       1:13.29 /usr/sbin/syslogd -s -c -c -l /var/dhcpd/var/run/log -P /var/run/syslog.pid -f /etc/syslog.conf -b 192.168.1.1
        34814  -  Ss       4:24.40 /usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /etc/dhcpd.conf -pf /var/run/dhcpd.pid fxp0 sis0
        38953  -  Ss       3:50.35 /usr/local/sbin/dhcpd -6 -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /etc/dhcpdv6.conf -pf /var/run/dhcpdv6.pid fxp0
        39293  -  Is       0:00.07 /usr/local/sbin/dhcpleases6 -c /usr/local/bin/php-cgi -f /usr/local/sbin/prefixes.php|/bin/sh -l /var/dhcpd/var/db/dhcpd6.leases
        80698  0  S+       0:00.00 grep dhcp
        

        Line 1, 4 and 5 are not related.
        For me, line 2 is the IPv4 process and line 3 the IPv6 process of dhcpd.

        Check also :

        [2.4.3-RELEASE][admin@pfsense.brit-hotel-fumel.net]/root: sockstat -4l | grep 67
        dhcpd    dhcpd      34814 8  udp4   *:67                  *:*
        root     xinetd     18673 0  udp4   127.0.0.1:6969        *:*
        

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

        JKnottJ 1 Reply Last reply Reply Quote 1
        • JKnottJ
          JKnott @Gertjan
          last edited by

          @gertjan said in DHCP-Server not handing out leases, "please make sure no other dhcp server is running...":

          The message doesn’t mean some other DHCP server is running on your LAN, but some other dhcp server is running on your pfSense box.

          Quite so. Multiple DHCP servers are permitted on a LAN and may be used for redundancy etc.. I also got the impression it was about multiple servers on one box. That would definitely cause problems.

          PfSense running on Qotom mini PC
          i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
          UniFi AC-Lite access point

          I haven't lost my mind. It's around here...somewhere...

          1 Reply Last reply Reply Quote 0
          • B
            BenDroid
            last edited by BenDroid

            Thank you all for you responses.

            @gertjan said in DHCP-Server not handing out leases, "please make sure no other dhcp server is running...":

            Try this : kill them all - and restart (the) one !

            How do I do this? What do you mean by kill and by them all? Which one should I restart?

            I ran the commands you gave me, here are the outputs, I can't get any useful info out of them. If you could break it down for me, I would be very thankful.

            0_1528057082489_1.png

            I noticed that the second command didn't work, I can't figure out why though. Any suggestions?

            I should also probably mention I tried this but that didn't work also.

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

              @bendroid said in DHCP-Server not handing out leases, "please make sure no other dhcp server is running...":

              I noticed that the second command didn’t work, I can’t figure out why though. Any suggestions?

              Yes, Try the Ctrl-C Ctrl-V method.
              You typed

              sockstat -41 | grep 67
              

              it should be

              sockstat -4l | grep 67
              
              (There should be a letter 'l', non a number '1' (one) after the '4')
              

              And instead of coping images, can you copy the text, so we can see the end of the "ps ax" output ?
              Like this :

              [2.4.3-RELEASE][admin@pfsense.brit-hotel-fumel.net]/root: ps ax | grep dhcp
              23027  -  Ss       1:15.56 /usr/sbin/syslogd -s -c -c -l /var/dhcpd/var/run/log -P /var/run/syslog.pid -f /etc/syslog.conf -b 192.168.1.1
              34814  -  Ss       4:48.31 /usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /etc/dhcpd.conf -pf /var/run/dhcpd.pid fxp0 sis0
              ....
              

              Instead of :

              ....
              34814  -  Ss       4:48.31 /usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /etc/dhcpd.conf -pf /var/run/d
              ....
              

              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
              • B
                BenDroid
                last edited by BenDroid

                Hi

                Ah looked right over that one. Thanks for the detailed explanation though.

                Output for 'ps ax | grep dhcp' when I run it in the Command Prompt in the web gui:

                57253  -  S        0:00.00 sh -c ps ax | grep dhcp 2>&1
                57387  -  S        0:00.00 grep dhcp
                63737  -  Ss       0:06.44 /usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chro
                96036  -  Is       0:01.10 /usr/sbin/syslogd -s -c -c -l /var/dhcpd/var/run/log
                

                And when I run it on locally administered machine (IPMI Console, so no copy sorry):

                0_1528143329052_00899f3d-42af-4ace-a107-323f17a7ca76-image.png

                I don't know hot to get the ful line. Any suggestions? Which other console is there? I can't SSH into pfSense.

                Output for 'sockstat -4l | grep 67':

                dhcpd    dhcpd      63737 7  udp4   *:67                  *:*
                root     nginx      55679 5  tcp4   *:80                  *:*
                
                1 Reply Last reply Reply Quote 0
                • GertjanG
                  Gertjan
                  last edited by Gertjan

                  @bendroid said in DHCP-Server not handing out leases, "please make sure no other dhcp server is running...":

                  dhcpd Can't bind to dhcp address: Address already in use

                  Hummm.
                  Google told me this : https://forum.netgate.com/topic/81232/can-t-bind-to-dhcp-address-address-already-in-use/16 - it's time to try what is proposed over there.

                  edit : stop the dhcpd server on all 'LAN' interfaces.
                  Check that it isn't running anymore in the GUI.
                  Do the same thing using the

                  ps ax | grep dhcp
                  

                  command. There shouldn't be any instance of dhcpd running.
                  Reboot pfSEnse.
                  Start the dhcpd again.

                  Check also the dhcp log, when you start the dhcpd - as shown in the URL above.

                  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
                  • B
                    BenDroid
                    last edited by BenDroid

                    I don't know if it helps but here's some more info on my setup: I have my LAN on a lagg (lagg0). Range is 192.168.0.0/22 and Router IP-Adress is 192.168.2.1. Yes I know it's weird, but it's how I want it. And I just upgraded to pfSense-DEVELOPMENT 2.4.4.a.20180604.2150. This install is a fresh clean install not much settings changed. So there shouldn't be any settings that could have borked it.

                    I tried the following steps from the Link you posted:

                      1. Disable DHCP service on LAN
                      1. Check that there is no dhcp running under services
                      1. Reboot pfSense
                      1. Enable DHCP service on LAN

                    Didn't work.

                      1. Stop dhcp service under services
                      1. Check that the service is stopped
                      1. Reboot pfSense
                      1. Start dhcp service under services

                    Also didn't work.

                    Also: In the log it now only displays this:

                    Jun 5 21:47:03	dhcpd		Internet Systems Consortium DHCP Server 4.3.6-P1
                    Jun 5 21:47:03	dhcpd		Copyright 2004-2018 Internet Systems Consortium.
                    Jun 5 21:47:03	dhcpd		All rights reserved.
                    Jun 5 21:47:03	dhcpd		For info, please visit https://www.isc.org/software/dhcp/
                    Jun 5 21:47:03	dhcpd		Config file: /etc/dhcpd.conf
                    Jun 5 21:47:03	dhcpd		Database file: /var/db/dhcpd.leases
                    Jun 5 21:47:03	dhcpd		PID file: /var/run/dhcpd.pid
                    Jun 5 21:47:03	dhcpd		Internet Systems Consortium DHCP Server 4.3.6-P1
                    Jun 5 21:47:03	dhcpd		Copyright 2004-2018 Internet Systems Consortium.
                    Jun 5 21:47:03	dhcpd		All rights reserved.
                    Jun 5 21:47:03	dhcpd		For info, please visit https://www.isc.org/software/dhcp/
                    Jun 5 21:47:03	dhcpd		Wrote 0 leases to leases file.
                    Jun 5 21:47:03	dhcpd		Listening on BPF/lagg0/ac:1f:6b:44:bc:2d/192.168.0.0/22
                    Jun 5 21:47:03	dhcpd		Sending on BPF/lagg0/ac:1f:6b:44:bc:2d/192.168.0.0/22
                    Jun 5 21:47:03	dhcpd		Sending on Socket/fallback/fallback-net
                    Jun 5 21:47:03	dhcpd		Server starting service.
                    

                    Which would technically indicate that the dhcp service is running now. But devices are still not getting an IP-adress. Could it have something todo with my lagg?

                    Also: here's my dhcpd.conf:

                    option domain-name "bendroid.ch";
                    option ldap-server code 95 = text;
                    option domain-search-list code 119 = text;
                    option arch code 93 = unsigned integer 16; # RFC4578
                    
                    default-lease-time 7200;
                    max-lease-time 86400;
                    log-facility local7;
                    one-lease-per-client true;
                    deny duplicates;
                    ping-check true;
                    update-conflict-detection false;
                    authoritative;
                    subnet 192.168.0.0 netmask 255.255.252.0 {
                    	pool {
                    		option domain-name-servers 192.168.2.1,192.168.2.102;
                    
                    		range 192.168.2.121 192.168.2.199;
                    	}
                    
                    	option routers 192.168.2.1;
                    	option domain-name "bendroid.ch";
                    	option domain-name-servers 192.168.2.1,192.168.2.102;
                    
                    }
                    

                    And I gotta ask: What does the command "ps ax | grep dhcp" do exactly?

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

                      @bendroid said in DHCP-Server not handing out leases, "please make sure no other dhcp server is running...":

                      Which would technically indicate that the dhcp service is running now. But devices are still not getting an IP-adress. Could it have something todo with my lagg?

                      So, the log indicates that all should be fine now.
                      It's time to wireshark, check if DHCP requests are coming into pfSense.

                      I don't know what "lagg" is (I'll look it up).

                      Btw : the earth, and all things on it and around it were created in several days - a week, I guess.
                      The story continues : on day 8 it was the command 'ps' - and on day 9 it as 'grep'.
                      (Ok, I admit, I made this one up just right now)
                      These two commands could be the most documented things on the Internet. I even tend to say that the Internet was created with the help of these two commands.
                      Really, Google them up ^^

                      Also : the "|" should be seen as "pipe the output of the left part of the | into the command on the right part".

                      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 1
                      • B
                        BenDroid
                        last edited by

                        Alright, I figured it out. Stupid me had a DHCP Relay configured on the switch. I noticed it when I started doing packet captures and there was a complete absence of any DCHP-packets over UDP. I remembered thinking it would reduce network load if there weren't DHCP-packets flying aroung all the time. Is that still true nowadays?

                        0_1528311584678_6ef9a218-68ec-4f50-9d8f-d960a8f6a947-image.png

                        Now pfSense receives DHCP-packets and is handing out IP-Adresses. Problem solved on my terms.

                        0_1528312089230_33a7eea5-9623-4118-892e-96f88848d2ed-image.png

                        Big thanks to @Gertjan for staying and helping. And of course for the hint to start packet capturing.

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