Forcing dhcpd On pfSense To Forget…

So I was playing around with 2 new TP-Link HS110 units I bought from Amazon, and I was attempting to swap the two with two other existing units (which had older firmware), having the two new units take the identity (name/ID and pfSense dhcpd statically defined IP addresses) of the “older” units… Review of that device aside, I was pulling my hair out because the old units kept getting their old IPs, as did the new units!

Funnily enough, the units appear to “take turns” “phoning home” – such that in the Kasa control application, there were duplicates of the old unit name/IDs shown, and it “flip-flopped” on showing the availability (and also the recorded energy consumption).

I figured it must be the DHCP service/daemon, since I kept seeing the DHCPDISCOVER and DHCPOFFER in the dhcpd logs.

Time to roll up my sleeves and fix this…

After many device resets and Kasa re-registration, general fooling around with the device switch-on order and even digging into the dhcpd configuration file, I finally came across this pfSense forum post, and it finally clicked: delete the configuration cache file – possibly due to my DHCPd configuration “hack” (which deserves a separate post at length), it appears that, despite:

  • saving, applying the changes (as prompted)
  • manually restarting the DHCP service/daem0n
  • manually searching and editing the (chroot‘d)
    • /var/dhcpd/var/run/dhcp.leases
    • /var/dhcpd/var/run/dhcp.leases~
    • /var/dhcpd/etc/dhcpd.conf

2020/02/10 Update: I never got around to documenting that hack/fix, but it has now been accepted and merged…

The configuration for the old devices remained, even while the new device configuration was added.

Beyond the unknown question of why the DHCP service/daemon would happily hand out conflicting IP address (albeit as configured – although, admittedly, an unexpired lease does not actually equate to being in use – for which I am aware DHCP does not actually check), the service was somehow still picking up the information from the cache.

As per the pfSense forum post above, I deleted the /tmp/config.cache and everything was fixed (after a service restart)!

Leave a Reply