Hi tech, I've been playing with dhcpleased on my laptop, where I run with a failover trunk, consisting of iwn and em interfaces as trunkports. This configuration has worked well for a few years with dhclient. When testing dhcpleased I found a subtle difference in behaviour that took me a little while to figure out.
I initially couldn't get dhcpleased to operate on the trunk interface, and eventually realised that it is because dhcpleased acts on the combination of the AUTOCONF4 flag and interface state (IFF_UP). In contrast, dhclient will bring the interface up automagically during initialisation. Intuitively, I actually expected that the trunk interface state would be controlled by collective state of its trunkports - i.e. up if any single trunkport is marked as up. After further consideration I'm doubtful as to whether that would make sense at all, and such behaviour risks ping-pong up/down games if root decides to intervene and manually set the state. In any case, it's not how trunk actually works. So...here is a proposal for updating various man pages to try help others who make a similar migration to dhcpleased. It's a bit of a scattershot approach and the wording can probably be improved, but it is hopefully consistent with the existing pattern for describing auto interface configuration, and it at least should prompt a user to double-check their interface state before they (incorrectly) conclude that dhcpleased doesn't work on trunk interfaces. Paul Index: sbin/ifconfig/ifconfig.8 =================================================================== RCS file: /cvs/src/sbin/ifconfig/ifconfig.8,v retrieving revision 1.362 diff -u -p -u -p -r1.362 ifconfig.8 --- sbin/ifconfig/ifconfig.8 20 Feb 2021 01:21:04 -0000 1.362 +++ sbin/ifconfig/ifconfig.8 7 Mar 2021 11:52:31 -0000 @@ -161,6 +161,13 @@ automatically configures IPv6 addresses .Sy AUTOCONF6 set. .Pp +.Xr dhcpleased 8 +automatically configures IPv4 addresses for +.Dq up +interfaces with +.Sy AUTOCONF4 +set. +.Pp .Xr dhclient 8 only configures interfaces with .Sy AUTOCONF4 Index: sbin/dhcpleased/dhcpleased.8 =================================================================== RCS file: /cvs/src/sbin/dhcpleased/dhcpleased.8,v retrieving revision 1.2 diff -u -p -u -p -r1.2 dhcpleased.8 --- sbin/dhcpleased/dhcpleased.8 26 Feb 2021 17:14:25 -0000 1.2 +++ sbin/dhcpleased/dhcpleased.8 7 Mar 2021 11:52:54 -0000 @@ -29,8 +29,10 @@ is a dynamic host configuration protocol (DHCP) daemon for clients. It requests IP configuration information from for example those offered by .Xr dhcpd 8 , -on interfaces with the -.Sy AUTOCONF4 +on +.Dq up +interfaces with the +.Dq AUTOCONF4 flag set. See .Xr hostname.if 5 Index: share/man/man5/hostname.if.5 =================================================================== RCS file: /cvs/src/share/man/man5/hostname.if.5,v retrieving revision 1.73 diff -u -p -u -p -r1.73 hostname.if.5 --- share/man/man5/hostname.if.5 23 Dec 2020 17:22:07 -0000 1.73 +++ share/man/man5/hostname.if.5 7 Mar 2021 11:53:14 -0000 @@ -229,7 +229,9 @@ up The following packed formats are valid for configuring network interfaces with dynamic addresses. .Pp -For IPv4 dynamic addressing using DHCP, the literal string +For IPv4 dynamic addressing using +.Xr dhclient 8 , +the literal string .Dq dhcp followed first by .Xr dhclient 8 @@ -243,6 +245,20 @@ is executed before .Bd -ragged -offset indent .Li dhcp .Op Va dhclient_options +.Op Va ifconfig_options +.Ed +.Pp +For IPv4 dynamic addressing using +.Xr dhcpleased 8 , +the literal string +.Dq inet autoconf up +followed by any options to be passed to +.Xr ifconfig 8 . +Note that +.Xr dhcpleased 8 +must also be enabled. +.Bd -ragged -offset indent +.Li inet autoconf .Op Va ifconfig_options .Ed .Pp
