Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Aug 2022 12:16:32 +0100
From:      Roy Marples <roy@marples.name>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Import dhcpcd(8) into FreeBSD base
Message-ID:  <64e22fba-3f34-a419-2e51-7dfa21199919@marples.name>
In-Reply-To: <20220807.232337.383956020917382126.hrs@FreeBSD.org>
References:  <e401671f-6a67-49ed-bc41-e8fbb9de27cb@www.fastmail.com> <20220807.232337.383956020917382126.hrs@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 07/08/2022 15:23, Hiroki Sato wrote:
>   1) Import dhcpcd and make it invoked via Other Configuration flag
>      in RA for DHCPv6.  This means that the rtsold daemon remains a
>      consumer of RA messages, and the default value of the -O option is
>      set to run dhcpcd.

I don't think this is a viable option as there is no easy way to transition from 
Other to Managed (or the other way around) from the dhcpcd commandline or signals.

Also, please consider than dhcpcd supports DNSSL and RDNSS options from RA 
messages whereas FreeBSD rtsold/kernel RA do not (please correct me if I'm wrong).
This allows for a fully working IPv6 only setup without DHCPv6.

> 
>   2) Keep the dhclient utility intact and add a knob to choose dhclient
>      or dhcpcd (or something else) for DHCPv4.  The current rc.d
>      scripts for DHCPv4 can be adjusted to use another client
>      supporting a per-interface mode.

I would argue that having knobs to control dhcpcd (or any other similar network 
tool for that matter) in rc.conf per interface is a bad idea because this 
discourages running dhcpcd in manager mode. You even note this below, but here 
are some more comments.

Sure it works fine for the one interface wired system - which admitedly is the 
most popular setup. But when more than one interface comes into play or you have 
plugable interfaces it then becomes more complicated and will consume more 
resources having many more daemon runing to allow capsicum and makes dhcpcd just 
as predictable as dhclient on a multi-homed system (ie it's not predictable).

I modified wpa_supplicant upstream to support the -M directive (I don't know if 
FreeBSD compiles wpa_supplicant with CONFIG_MATCH_IFACE defined) to allow 
plugable interfaces just for this reason.

I suggest just running dhcpcd as you would any other service in rc.conf

>   The dhcpcd daemon can handle various protocols of IPv4/IPv6 and watch
>   multiple interfaces, so the suggestions above might sound like an
>   underestimation of the capability.  I am concerned that changes to
>   replacing dhclient/rtsold will break the existing configurations.
>   Especially for IPv4, dhclient is mature, and many people have used
>   custom dhclient.conf and dhclient-script for years.  I believe we
>   will get little gain from such change.

We can leave current dhclient/rtsold configuration intact and suggest people 
move to dhcpcd by themselves.
People that want DHCPv6 or a better DHCP or RA expierience already have some 
solution in place which might even be dhcpcd from ports. I don't see any reason 
to stamp on their toes.

If FreeBSD does import dhcpcd, then I would suggest any talk of removal of 
dhclient can happen after a version of two.

> 
>   In 1)+2), there is no POLA for users of other DHCPv6 clients such as
>   dhcp6c or ISC's dhclient -6.  A full-blown dhcpcd configuration,
>   which replaces dhclient/rtsold, is still possible.  The cons are that
>   this is a partial integration of dhcpcd, which prevents some useful
>   feature available in the master mode, and some complexity remains in
>   the rc.d scripts.  I think these are a trade-off.  I am interested in
>   whether this integration has a big problem when people use the
>   imported dhcpcd.
> 
>   And probably we have to revisit this integration when we want to
>   support DHCP 4o6 or something that involves IPv4 and IPv6 at the same
>   time.  The flexibility of the "toolbox" approach would be helpful in
>   minimizing the impact on the existing configurations when more future
>   integration change occurs.

Agreed. I noted my concerns above and would favour a full blown dhcpcd 
configuration for new installs and leave the current dhclient/rtsold for exising 
installs. No need to force people to move.

Roy



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?64e22fba-3f34-a419-2e51-7dfa21199919>