Re: bridge and async dhcp in rc.conf

From: David Horn <dhorn2000_at_gmail.com>
Date: Sun, 12 Oct 2025 17:19:36 UTC
On Sat, Oct 11, 2025 at 12:17 PM David Horn <dhorn2000@gmail.com> wrote:

> I seem to have run into a corner case with bridge support and DHCP that
> seems to have a trivial fix.
>
> Using bridge0 with an upstream interface (em0) does not allow me to do
> normal rc.conf entries for DHCP to the bridge interface (em0 is not allowed
> to get addresses since it is a member of the bridge)  I use dual-stack
> IPv4/IPv6 everywhere as well.  I found an example here:
> https://wiki.freebsd.org/crest/the-correct-way-to-configure-bridges-in-freebsd-for-ipv6-and-ipv4
> that did not work for me.  I checked the handbook documentation here:
> https://docs.freebsd.org/en/books/handbook/advanced-networking/#network-bridging
> and there are no examples for bridge DHCP on boot using /etc/rc.conf.
> Please consider added example once this fix lands.
>
> Example /etc/rc.conf config:
>
> ifconfig_em0="up -tso -vlanhwtso"
> cloned_interfaces="bridge0"
> create_args_bridge0="addm em0 edge em0"
> ifconfig_bridge0="up DHCP"
> ifconfig_bridge0_ipv6="inet6 auto_linklocal accept_rtadv -ifdisabled"
> rtsold_enable="yes"
> rtsold_flags="-i -m bridge0"
>
> The /etc/rc.conf interface variable "DHCP" normally is used to define for
> the /etc/rc.d startup scripts and devd rules to automatically provide async
> DHCP for interfaces at "LINK_UP" events.  When debugging this, I noticed
> that this does not work as expected with bridge interfaces, but does with
> ethernet and 802.11 interfaces.   I temporarily used "SYNCDHCP" for this
> interface config and worked around the problem until my curiosity got the
> best of me to debug further.
>
> Looking at /etc//devd/dhclient.conf, I noticed that only two media-types
> are supported for async DHCP on LINK_UP.  I added a third media type to
> this configuration file for bridge and it started working for me.
>
> <snip old OBE patch>

Submitted Bug 290173 and an improved patch here:
https://reviews.freebsd.org/D53051

Answering my own question, this does not seem to impact lagg, just bridge
after testing multiple scenarios of async DHCP.


> --Thanks!
> -_Dave H
>
>
>
>