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

    Help! DHCP static mappings not working

    Scheduled Pinned Locked Moved DHCP and DNS
    4 Posts 2 Posters 4.7k 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.
    • M
      metalliqaz
      last edited by

      I just replaced a custom router solution with pfSense.  I have configured all the important hosts on my local network to have static DHCP mappings and have given them host overrides in the DNS resolver.

      The DHCP static mappings are not working for any of my network equipment.  The NAS is unreachable under its correct host name and I can't get to the admin screens for my access points because they are getting random IPs.

      The system is acting very strangely because from the logs I can tell that many machines on the network are getting leases, however none of them show up in the DHCP leases pages, only in the logs.

      For example, take my NAS:

      DHCP Static Mapping:
      MAC=00:15:17:xx:xx:xx IP=192.168.1.4 Hostname=tank

      Host Override:
      Host=tank Doman=my_domain.net IP=192.168.1.4

      So, it was happy with the 192.168.1.4 address from the old server, but once it expired, it got 192.168.1.106 from the new pfsense box.  The system is online, but the DHCP server happily gives it the wrong IP:

      Status->DHCP Leases:
      Shows 0 active leases, even though several non-static machines are online.
      IP:192.168.1.4 MAC:00:15:17:xx:xx:xx    Host:tank Start:n/a End:n/a offline Type:static

      Now the log:
      Aug 28 15:50:43 dhcpd DHCPREQUEST for 192.168.1.106 from 00:15:17:xx:xx:xx(freenas) via em1
      Aug 28 15:50:43 dhcpd DHCPACK on 192.168.1.106 to 00:15:17:xx:xx:xx(freenas) via em1

      What!  On my old system, it didn't matter what the server requested, it got the IP I specified.

      So what on earth is going on here???  I have to be able to force servers, printers, and networking equipment to have static IP addresses so they are reachable by DNS name.  I have triple-checked that the mac addresses are correct.

      By the way, my windows boxes are playing nice and are getting the correct IPs from the server.

      Please, if anyone can help, please do so.  I'm desperate to get my network back up and running.  I can't go back to the old system because it has already been decommissioned.

      1 Reply Last reply Reply Quote 0
      • M
        metalliqaz
        last edited by

        Update:  I have not tacked down the root cause yet, but I did get my NAS back online.  I was looking at the leases file in /var/dhcpd/var/db, and I noticed that it didn't have a lease for the addresses it was giving out.  All it has were old ones that were given out when I was still in the midst of configuring the server.  Also, strangely absent was the dhcpd.pid from /var/dhcpd/var/run.  I deleted the leases and rebooted both the firewall and the NAS.  It came back alive and look:

        Aug 28 16:17:12 dhcpd DHCPREQUEST for 192.168.1.106 from 00:15:17:xx:xx:xx via em1: lease 192.168.1.106 unavailable.
        Aug 28 16:17:12 dhcpd DHCPNAK on 192.168.1.106 to 00:15:17:xx:xx:xx  via em1
        Aug 28 16:17:12 dhcpd DHCPDISCOVER from 00:15:17:xx:xx:xx via em1
        Aug 28 16:17:12 dhcpd DHCPOFFER on 192.168.1.4 to 00:15:17:xx:xx:xx via em1
        Aug 28 16:17:14 dhcpd DHCPREQUEST for 192.168.1.4 (192.168.1.1) from 00:15:17:xx:xx:xx via em1
        Aug 28 16:17:14 dhcpd DHCPACK on 192.168.1.4 to 00:15:17:xx:xx:xx via em1

        It worked exacly as I was suspecting.

        So I'm starting to think that there is a bug in pfSense 2.3.2 that somehow causes the dhcpd to chroot to the wrong places when it is reloaded.  I reloaded the configuration many times while setting it up.  I think the server somehow got itself running without the correct chroot and therefore without access to the dhcpd.conf file with all my static mappings.

        Only a guess right now, though.

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

          I seem to be having the same issue. Any luck figuring it out?

          1 Reply Last reply Reply Quote 0
          • M
            metalliqaz
            last edited by

            @bigjoe714:

            I seem to be having the same issue. Any luck figuring it out?

            Basically a reboot.

            Above I had been speculating that the chroot was somehow messed up.  However, since then I discovered that /var/run is actually a RAMdisk, and I think it's more likely something goofed up with that.  Obviously, I can't troubleshoot further until it happens to me again.

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