Moving DHCP to Kea, and the Renewal Test That Took a Host Offline
The DHCP cutover from the firewall to Kea went cleanly. The follow-up test of an existing client's renewal did not: two DHCP clients on one interface and a cascading address delete took the machine off the network for ten minutes.

Key Architectural Takeaways
- Web-UI admin on a firewall and Unix root are different privileges; check which one your account actually has.
- Never drive DHCP renewal tests with raw dhclient and ip addr on a NetworkManager host; use nmcli.
- Deleting the primary address of a subnet can drop all the secondaries, because promote_secondaries is off by default.
The cutover
The plan moved DHCP from the firewall to Kea on a dedicated host, with a keepalived address as the DNS VIP. The runbook step: turn DHCP off on the firewall, start Kea, and verify with a fresh client and an existing one.
Getting root on the firewall was the first obstacle. A read-only service account was a web-UI administrator, but at the OS level it was an ordinary user: the config file was root-owned, there was no sudo and no known root password. Web-GUI privilege and Unix root are different things on pfSense. We added the fleet's admin key to root's authorized_keys through the web UI's built-in Diagnostics command prompt. The first attempt silently did nothing because /root/.ssh/ did not exist, and a redirect into a missing directory just fails.
We tried pfSense's scripting shell next and found that its -c flag collides with php-cgi's own -c (an alternate php.ini path), so the include path is lost. We wrote small explicit PHP files that load the same three include files pfSense's pages use, edit the config, call write_config() and reload DHCP, which is the path the web UI's Save button takes.
The cutover was clean: DHCP enable removed from the LAN config, no dhcpd process left, nothing listening on port 67, Kea active and listening on its own address and the VIP. A fresh-client test with a read-only broadcast-dhcp-discover returned a real offer with the right DNS server and lease times.
The outage
We also wanted proof that an existing client renews. We tried to force a renewal on a laptop-class server over SSH, and it went wrong in two compounding ways.
- Two DHCP clients on one interface. NetworkManager's built-in client managed the connection, and a separately installed classic
dhclientwas also present, neither aware of the other. Runningdhclient -randdhclientadded a second address next to the first and left a daemon running that NetworkManager knew nothing about. - A cascading delete. Cleaning up with
ip addr delon the primary address did not remove just that one. With the defaultpromote_secondaries=0, Linux drops all addresses in that subnet when the primary goes, so both addresses disappeared at once and IPv4 connectivity fell to zero. The Tailscale link rode on the same dead physical link.
A follow-up dhclient -r hung for the full 120 seconds against a host that had just lost its route, then the SSH session gave up. Recovery needed someone at the keyboard: kill the stray daemon, then nmcli connection up so NetworkManager reasserted its own connection. One clean address came back, and the resulting Kea lease turned out to be a perfectly good answer to our original question, via a much rockier path.
Lessons
- On a NetworkManager host, test renewals with
nmcli connection down/upornmcli device reapply, so exactly one thing manages the interface. If you do not know the client mechanism, check first. - If a remote host's connectivity drops, one timed-out command is the signal to stop and check reachability another way, not to try variations of the same command.
Takeaway
A clean change plus an optional extra test is where the outage happens. Decide in advance which test is needed, and do it with the tool that owns the interface.
Some of what's described here is a design that hasn't been fully tested yet; those parts say so in the text.