tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: MVP for a DHCP server (was Re: ISC's EoL dhcp suite, including dhcpd)



 ---- On Mon, 14 Jul 2025 14:20:28 +0100  Martin Husemann <martin%duskware.de@localhost> wrote --- 
 > On Mon, Jul 14, 2025 at 01:09:53PM +0100, Roy Marples wrote:
 > > So the question is, what is the Minimum Viable Product of a DHCP server for replacing ISC dhcpd in the NetBSD base system?
 > > Please answer with an idea of how it should look without having to refer to another resource.
 > 
 > Yay!
 > 
 > So I have a few things that I need (but I am not sure any of this
 > qualifies as "minimum"):
 > 
 >  - once you have configuration, the (good) defaults that you picked
 >    partly need to be configurable, like my dhcp server's IPv4
 >    currently ends with .188. And the range starting at .10 should be
 >    flexible.

I'm curious as to why .188? Also, could it be changed to .1?
I'm open to changing it, to the "first matched private address" but does that influence the starting address of the automatic pool?

 >  - there needs to be a way to wire certain MAC addresses to fixed IP
 >    adresses (even within the dynamic range) - I have tons of affected
 >    devices, but my setup certainly is atypical.

Why do you need to wire hosts to fixed IP addresses?

This is an important question because there is no equivalent for DHCPv6 as DHCPv6 does not carry a hardware address option.
DHCPv6 and DHCPv4 Client ID MUST be treated as opaque values
Even Infiniband with DHCP has this issue because the hardware address does not fit inside the chaddr field and needs to use a Client ID.
https://gitlab.isc.org/isc-projects/kea/-/issues/3331

My view is that if you need a host to be a fixed IP address then please configure the fixed IP address on the host and use the INFORM function.
dhcpcd has supported this for years.
IF it's because the DNS entry is "fixed", could we consider using mDNS as the MVP for this?
I think my latest NetBSD install had mDNS on and configured by default, but I could be wrong.

 >  - support for netbooting clients, with different "next" servers
 >    (again the dhcp servers address is a good default).
 >    This includes semi-intelligent matching on the name presented
 >    by the device to select different values for the root-path option.
 >    E.g. I have this (painfull) stuff a few times in my configuration:
 > 
 > host unpluged {
 >         hardware ethernet 00:50:43:01:83:1e;
 >         fixed-address 192.168.150.127;
 >         next-server 192.168.150.188;
 >         if option vendor-class-identifier = "NetBSD:evbarm:kernel:8.0" {
 >                 option root-path "/disk/hosts/evbarm-8";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:8.0_STABLE" {
 >                 option root-path "/disk/hosts/evbarm-8";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:8.1_STABLE" {
 >                 option root-path "/disk/hosts/evbarm-8";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:8.2_STABLE" {
 >                 option root-path "/disk/hosts/evbarm-8";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:9.0_BETA" {
 >                 option root-path "/disk/hosts/evbarm-9";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:9.0" {
 >                 option root-path "/disk/hosts/evbarm-9";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:9.0_STABLE" {
 >                 option root-path "/disk/hosts/evbarm-9";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:9.0_RC1" {
 >                 option root-path "/disk/hosts/evbarm-9";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:9.0_RC2" {
 >                 option root-path "/disk/hosts/evbarm-9";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:9.1" {
 >                 option root-path "/disk/hosts/evbarm-9";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:9.1_STABLE" {
 >                 option root-path "/disk/hosts/evbarm-9";
 >         [..]
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:10.0" {
 >                 option root-path "/disk/hosts/evbarm-10";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:10.0_STABLE" {
 >                 option root-path "/disk/hosts/evbarm-10";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:10.1" {
 >                 option root-path "/disk/hosts/evbarm-10";
 >         } else if option vendor-class-identifier = "NetBSD:evbarm:kernel:10.1_STABLE" {
 >                 option root-path "/disk/hosts/evbarm-10";
 >         } else {
 >                 option root-path "/disk/hosts/evbarm";
 >         }
 > 
 >    and I wish it would be simpler :-)

Blue sky thinking:

if regex_match($vendor-class-identifier, "^NetBSD:") {
  option next-server 192.168.150.188;
  option root-path regex_sub($vendor-class-identifier, "NetBSD:([^:]*):[^:]*:([0-9]*)", "/disk/hosts/$1-$2")
}

Doesn't cover the last else so needs more thought, or could it be covered somehow using regex(3)?

Anyway, this I suspect is the only MVP that NetBSD needs *to replace ISC dhcpd* as Netbooting is a thing.

 >  - the host-name, domain-name and dns server options should be configurable
 >    per peer (with proper defaults the server could derive from the host
 >    it is running on)

I suppose the MVP is allowing DNS Server and Domain name to be configurable on the command line.

Roy



Home | Main Index | Thread Index | Old Index