Re: dhcpsd released, a RFC2131 DHCP server (was Re: ISC's EoL dhcp suite, including dhcpd)

Roy Marples <[email protected]> Sun, 02 Nov 2025 11:16:35 +0000
Newsgroups gmane.os.netbsd.devel.network
Message-ID <[email protected]>
Hi Mike

 ---- On Sun, 02 Nov 2025 11:07:40 +0000  Mike Pumford <[email protected]> wrote --- 
 > 
 > 
 > On 02/11/2025 07:38, Roy Marples wrote:
 > > This is a DHCP server, driven by plugins rather than a specific
 > > configuration.
 > > 
 > > There is an auto plugin which makes an opinionated automatic
 > > DHCP setup based on your IP address.
 > > There is a leasefile plugin which stores the leases to a
 > > persistent flat file periodically.
 > > There is an ethers plugin to lookup a nodes hostname from their
 > > ethernet address.
 > 
 > I use a combination of automatic addressing and MAC locked addresses 
 > with manually specified DNS server entries and a few other additional 
 > DHCP options. Currently I generate a DHCP configuration file using a 
 > script to generate the static entries on top of the dynamic pool.
 > 
 > Based on what I can gather from a read of the manual pages it would make 
 > my life more complicated. Rather than having one configuration file it 
 > now looks like I would probably be forced to write, or in my case 
 > GENERATE, lua script as there doesn't appear to be an obvious 
 > configuration file to place my settings into.
 > 
 > I'm also a bit wary of using the ethers database. My first thought was 
 > what side effects is putting my MAC -> IP mapping going to have? Are 
 > there other things that look things up in that database that I don't 
 > know about given that its actually part of the base system?
 > Mike

The ethers and addrinfo plugins are designed to work from existing data sources.
Some other DHCP servers support this concept too.

But you don't have to use them and configure your static mappings entirely within LUA.
How do you this is entirely up to you as we just have entry/exit points.
The example I supply looks it up via LUA tables which are simple and pretty fast.
htype -> ethers -> hostname -> ip address.

So in other words if you just use LUA you can have it all in one config file.
In your case you would generate a simple LUA config file which the etc/dhcpsd/dhcp.lua file would then include.
So two files, one lua script you manage and the other a lua config which you include.
Or just generate one script. Your choice.

Roy