Finally (2), I have some good enough DHCP server!
Tried kea from ISC — it works but requires some additional actions to be launched under #NetBSD. It has very strange default paths for file with leases, PIDs and logs:
- /usr/pkg/var/lib/kea/
- /usr/pkg/var/lib/run/kea
- /usr/pkg/var/log/kea
BTW, it could be changed via playing with some environment variables.
Also, the default startup script uses keactrl to launch DHCP server and keactrl requires some configuration for it. So, to use "service kea start" there are two configuration files are necessary:
- /usr/pkg/etc/keactrl.conf — the main configuration file for server.
- /usr/pkg/etc/kea/keactrl.conf — the configuration file for keactrl.
Then, I tried the dhcpsd — the new promising successor of ISC dhcpd, which could be configured with configuration file in Lua and conforms Unix FHS — all necessary files lies in the right places: /var/run, /var/log, etc. Sadly, it doesn't work: server starts but there are no leases for clients and no any errors in the log 😒
Then, I found cmu-dhcpd in the repos — there is a dhcpd from Carnegie Mellon University with some patches from Princeton. And, finally it works! And it also conforms Unix FHS: main configuration in the /etc/dhcpd.conf, PID-file in the /var/run/dhcpd.pid and logs in the /var/log/messages