From nobody Sat Oct 11 16:17:35 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ckTKt3Z9Lz6C6rm for ; Sat, 11 Oct 2025 16:17:54 +0000 (UTC) (envelope-from dhorn2000@gmail.com) Received: from mail-vk1-xa35.google.com (mail-vk1-xa35.google.com [IPv6:2607:f8b0:4864:20::a35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ckTKs3dvjz3NDp for ; Sat, 11 Oct 2025 16:17:53 +0000 (UTC) (envelope-from dhorn2000@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=fJ4qzq1J; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of dhorn2000@gmail.com designates 2607:f8b0:4864:20::a35 as permitted sender) smtp.mailfrom=dhorn2000@gmail.com Received: by mail-vk1-xa35.google.com with SMTP id 71dfb90a1353d-54a81bf36ebso292912e0c.3 for ; Sat, 11 Oct 2025 09:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760199467; x=1760804267; darn=freebsd.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=RTTikoznpGM/9doJbHfiQOo8liXE4hwZIYknr9cCFws=; b=fJ4qzq1JL4jOcYWwuwWTdUeQXtKIgIJDZ+h53mufM9SsmqNWGQhKLvtGgrz36QYmWV ZHzx2R7IbMaPonqgNUAoW+ssOvDyC2GNDMMCZ3f0s1TARo/6mcv0ytHGoMy+sys6I/Od IOaNQ9JUJsUOk0nWgsDzozhIQjE6l4JddtgOiPbpVuo6CwnWjlDXJ3geONdEKUD4DzZQ 1h/zJTLGzS1n+XVUBBXsN4poeCpvbAUUFw4ur2h1IbjJvHMpshV67dzrZqUv7AwiHzsn WxJXmcGtOk9j/2iFzIB5cGu888Z80JnB6QyxjkAUXKucIhZgOhWopTvcii3Pnwb7yrzS VzMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760199467; x=1760804267; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=RTTikoznpGM/9doJbHfiQOo8liXE4hwZIYknr9cCFws=; b=K8jeDwgaf6EB7Vnnox3mUolFkk89Kgf2YnGuxKCqX2oDeGS3ATh1VHsN3bultB7eCL Z9W5dyLXY1UrUnGrDQXBf8LbQP3zbIeoqC7bUGg+YFUG7tB5g7LSOasLrjsJAmoUkrIw vehKej1CAufkIRsCeqTTgAWM2eBqE2nxMK1BYeKxwqqqtaJ0NXeM134C5fUwkVEm8Z9d 52mnB+5Qs8+mMENFzv1FBe1wrsIOwkYRlyfK9sYFUv2z4PyCI+lBU6OZCECYG0tPxyb2 BSIbqkClI5O0ifRQoWvw0l6A4DM6yuQEAwQd8iqkggAi8IfBBN+ydmvEnifTvtwLqTc8 eEvQ== X-Gm-Message-State: AOJu0YwP4IDbThz2biSEqItAvRzwfEz6UsuIok1qxmIpw3vnZ8Ik9Cox aDQDxic/ujNzRKimk4+G90nT0xHuPbx0LlT/LRoLeXv4OGaQ4pCFIvzMuTt2J7iA0yFT8vCNgjf jF2Zsh0ZcQl916cHcbtLwdf48uV4BwQjQ31S7SJA= X-Gm-Gg: ASbGnctC9oLX5HYIQMYT2QXwG5pTlMXTlLEzoj5/y9HjGPdaSeenuBbO6amaZoivEfF DeMSqwF5YOXsWCjxIdNOy+Fpz2Am2FeukgJhR8o9UEdDClnPSEGSQodM+9k6IZimpM0L6arCoVm m37goIEyNcYOljOQ/uKrC0t0nYC8u7zL9TQ6l8EXvKbXzGMk7mgb90xswr1DLjgCFSkRCE7iBJV JlJrcb8nsywByryrtR5LYZRcW0BbyoAWgmMW7Q= X-Google-Smtp-Source: AGHT+IE680oIAHTzSMmZVvvKt9P16xZRMSz0nBtR0zReyM8EOWoHb3oqOK735wDXFoDGA7+fnyjMUCHIuumBm8YednE= X-Received: by 2002:a05:6102:d93:b0:522:4c98:17e with SMTP id ada2fe7eead31-5d5e22158b0mr6312436137.4.1760199467304; Sat, 11 Oct 2025 09:17:47 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 From: David Horn Date: Sat, 11 Oct 2025 12:17:35 -0400 X-Gm-Features: AS18NWD6nlI6FL-2_rrdxrzhqk2QtDGqFHYoWtIC3paCtPc2eT24myw0offnX80 Message-ID: Subject: bridge and async dhcp in rc.conf To: freebsd-current@freebsd.org Content-Type: multipart/alternative; boundary="000000000000fb8b510640e45fbb" X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.32 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.85)[-0.851]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_MEDIUM(-0.47)[-0.474]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCPT_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::a35:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ARC_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; MID_RHS_MATCH_FROMTLD(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+] X-Rspamd-Queue-Id: 4ckTKs3dvjz3NDp --000000000000fb8b510640e45fbb Content-Type: text/plain; charset="UTF-8" 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. Glad to put in a PR with a proposed patch for this, but the real question is are there OTHER media types that should be supported with async DHCP configurations automatically besides bridge via devd rules ? Does this also impact LAGG ? Index: /etc/devd/dhclient.conf =================================================================== --- /etc/devd/dhclient.conf (stock) +++ /etc/devd/dhclient.conf (local) @@ -12,6 +12,13 @@ }; notify 0 { + match "system" "IFNET"; + match "type" "LINK_UP"; + media-type "bridge"; + action "service dhclient quietstart $subsystem"; +}; + +notify 0 { match "system" "IFNET"; match "type" "LINK_UP"; media-type "802.11"; --Thanks! -_Dave H --000000000000fb8b510640e45fbb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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)=C2=A0 I use dual-stack IPv4/IPv6 everywhere = as well.=C2=A0 I found an example here:=C2=A0https://wiki.freebsd.org/crest/the-correct-way-to-configure-bridges-in-= freebsd-for-ipv6-and-ipv4 that did not work for me.=C2=A0 I checked the= handbook documentation here:=C2=A0https://docs.freebsd.o= rg/en/books/handbook/advanced-networking/#network-bridging and there ar= e no examples for bridge DHCP on boot using /etc/rc.conf.=C2=A0 Please cons= ider added example once this fix lands.

Example /e= tc/rc.conf config:

ifconfig_em0=3D"up -tso -v= lanhwtso"
cloned_interfaces=3D"bridge0"
create_= args_bridge0=3D"addm em0 edge em0"
ifconfig_bridge0=3D"up= DHCP"
ifconfig_bridge0_ipv6=3D"inet6 auto_linklocal accept_rt= adv -ifdisabled"
rtsold_enable=3D"yes"
rtsold_flags=3D= "-i -m bridge0"

The /etc/rc.conf int= erface variable "DHCP" normally is used to define for the /etc/rc= .d startup scripts and devd rules to automatically provide async DHCP for i= nterfaces at "LINK_UP" events.=C2=A0 When debugging this, I notic= ed that this does not work as expected with bridge interfaces, but does wit= h ethernet and 802.11 interfaces.=C2=A0 =C2=A0I temporarily used "SYNC= DHCP" for this interface config and worked around the problem until my= curiosity got the best of me to debug further.

Lo= oking at /etc//devd/dhclient.conf, I noticed that only two media-types are = supported for async DHCP on LINK_UP.=C2=A0 I added a third media type to th= is configuration file for bridge and it started working for me.
<= br>
Glad to put in a PR with a proposed patch for this, but the r= eal question is are there OTHER media types that should be supported with a= sync DHCP configurations automatically besides bridge via devd rules ?=C2= =A0 Does this also impact LAGG ?

Index: /etc/devd/= dhclient.conf
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--= - /etc/devd/dhclient.conf (stock)
+++ /etc/devd/dhclient.conf (local)@@ -12,6 +12,13 @@
=C2=A0};
=C2=A0
=C2=A0notify 0 {
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0match "system" =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0"IFNET";
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0match "type&q= uot; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"LINK_UP";
+ =C2= =A0 =C2=A0 =C2=A0 =C2=A0media-type =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0"bridge";
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0action "= service dhclient quietstart $subsystem";
+};
+
+notify 0 {=C2=A0 =C2=A0 =C2=A0 =C2=A0 match "system" =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0"IFNET";
=C2=A0 =C2=A0 =C2=A0 =C2=A0 match "= type" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"LINK_UP";=C2=A0 =C2=A0 =C2=A0 =C2=A0 media-type =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0"802.11";

--Thanks!
=
-_Dave H



--000000000000fb8b510640e45fbb--