Date: Sun, 12 Oct 2025 13:19:36 -0400 From: David Horn <dhorn2000@gmail.com> To: freebsd-current@freebsd.org Subject: Re: bridge and async dhcp in rc.conf Message-ID: <CAG7Wop=4jOcOQHQ9yEhB05o%2Ba3uy7gefVKGD6QGG88zHRiC0QA@mail.gmail.com> In-Reply-To: <CAG7WopnG-sioD-YoGhP3JjdugFUztm2ZpxzcEbiq%2B%2BG9niZZ7g@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] 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 > > > > [-- Attachment #2 --] <div dir="ltr"><div dir="ltr">On Sat, Oct 11, 2025 at 12:17 PM David Horn <<a href="mailto:dhorn2000@gmail.com">dhorn2000@gmail.com</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I seem to have run into a corner case with bridge support and DHCP that seems to have a trivial fix.<div><br><div>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: <a href="https://wiki.freebsd.org/crest/the-correct-way-to-configure-bridges-in-freebsd-for-ipv6-and-ipv4" target="_blank">https://wiki.freebsd.org/crest/the-correct-way-to-configure-bridges-in-freebsd-for-ipv6-and-ipv4</a> that did not work for me. I checked the handbook documentation here: <a href="https://docs.freebsd.org/en/books/handbook/advanced-networking/#network-bridging" target="_blank">https://docs.freebsd.org/en/books/handbook/advanced-networking/#network-bridging</a> and there are no examples for bridge DHCP on boot using /etc/rc.conf. Please consider added example once this fix lands.</div><div><br></div><div>Example /etc/rc.conf config:</div><div><br></div><div>ifconfig_em0="up -tso -vlanhwtso"</div><div>cloned_interfaces="bridge0"<br>create_args_bridge0="addm em0 edge em0"<br>ifconfig_bridge0="up DHCP"<br>ifconfig_bridge0_ipv6="inet6 auto_linklocal accept_rtadv -ifdisabled"<br>rtsold_enable="yes"<br>rtsold_flags="-i -m bridge0"<br></div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div></div></div></div></blockquote><div><snip old OBE patch></div><div><br></div><div>Submitted Bug 290173 and an improved patch here: <a href="https://reviews.freebsd.org/D53051">https://reviews.freebsd.org/D53051</a></div></div><div class="gmail_quote gmail_quote_container"><br></div><div class="gmail_quote gmail_quote_container">Answering my own question, this does not seem to impact lagg, just bridge after testing multiple scenarios of async DHCP.<br><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>--Thanks!<br></div><div>-_Dave H</div><div><br></div><div><br></div><div><br></div></div></div> </blockquote></div></div>help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG7Wop=4jOcOQHQ9yEhB05o%2Ba3uy7gefVKGD6QGG88zHRiC0QA>
