Static mapping with IP address from pool



  • Hi everyone,

    I'm a recent convert from a custom Debian+dnsmasq solution and absolutely loving pfSense so far. I have one nagging issue that I'd like to resolve more as a learning opportunity than because it's a serious problem. It looks like this forum is quite active with a lot of knowledgeable people so hopefully you can help me understand what's going on!

    I have a client "foo" on my network that reports in with a junky, non-user-modifiable DHCP client ID, e.g. foo-oem-123456. I'd like to configure pfSense such that this client takes foo.mynetwork in the local DNS instead of foo-oem-123456.mynetwork. In the past, I would have modified my dnsmasq configuration to either take a –dhcp-host=<mac>,foo option, or I would have added " <mac>foo" to /etc/ethers.

    It looks like pfSense has a way to address this as well. I added a static mapping for foo's MAC address with a hostname of "foo" and left the rest of the fields blank (to take the defaults), including the IP address. According to the inline documentation, "If no IPv4 address is given, one will be dynamically allocated from the pool."

    Unfortunately, the client is still taking foo-oem-123456.mynetwork in the DNS, and it appears to be ignoring the static mapping. foo.mynetwork is not in the DNS. Here's what I see in my DHCP leases table:

    | IP address | MAC address | Hostname | Online | Lease Type |
    | 192.168.0.102 | <mac></mac> | foo-oem-123456 | online | active |
    | | <mac></mac> | foo | online | static |

    This is what I expect to see:

    | IP address | MAC address | Hostname | Online | Lease Type |
    | 192.168.0.102 | <mac></mac> | foo | online | static |

    I've gone through the rigmarole of restarting services, releasing and renewing the DHCP lease, etc. with no change in the results. I feel like I have a good handle on the DHCP Server and DNS Forwarder options but I can't seem to find the magic combination that makes this work how I'd like. In the meantime, I've given this host a static IP address outside the pool.

    Thank you in advance for any suggestions,

    Mike</mac></mac>



  • I have the same problem.  Best I can tell, the ISC DHCPD daemon is ignoring the host mappings in the file.



  • I thought it might be related to the client already having an IP, but it's not.  I think pfSense is configuring dhcpd correctly according to the dhcpd man pages.  For some reason (and DHCPD is not logging why), it ignores the declarations that look like this:

    host s_lan_0 {
            hardware ethernet xxxx;
    option host-name "ap";
    }



  • @mwp821:

    It looks like pfSense has a way to address this as well. I added a static mapping for foo's MAC address with a hostname of "foo" and left the rest of the fields blank (to take the defaults), including the IP address. According to the inline documentation, "If no IPv4 address is given, one will be dynamically allocated from the pool."

    Yes, dynamically allocated from the pool. The hostname in that case is the one the host provides via its DHCP request. If you want to override the hostname in that manner, you must specify an IP in the mapping, then that hostname in the mapping will be used. The only purpose of putting in a static mapping with no IP is if you're using the "deny unknown clients' option. If you're not using that option, a static mapping with no IP has no affect on anything.



  • Yeah.

    Using the advice at http://serverfault.com/questions/37451/dhcp-logging-host-declarations-in-log-file, I could see that dhcpd IS matching the host entry.  But the leases file (which seems to be driving DNS) is based on the client provided hostname.

    I suppose any other route would require changing the resolver (or dhcpleases utility) to deal with this in a different way.


Log in to reply