Up until RELENG_13, creating a vlan in /etc/rc.conf did not matter if the syntax was ifconfig_vlan2="192.168.1.51/24 vlandev igb1 vlan 2" or ifconfig_vlan2="192.168.1.51/24 vlan 2 vlandev igb1" either used to work on RELENG_13 now only ifconfig_vlan2="192.168.1.51/24 vlan 2 vlandev igb1" works on RELENG_14. Not sure if the issue was intentional or not but should at least be noted if an deliberate POLA Short discussion at https://lists.freebsd.org/archives/freebsd-net/2024-May/004968.html
Emm, it is not order in rc, but there is something wrong with ifconfig(8). Steps to repeat: ``` # ifconfig vlan3 create 192.168.2.51/24 vlandev cxl0 vlan 3 ifconfig: both vlan and vlandev must be specified ```
Simpler steps to repeat: ``` # ifconfig vlan create vlan0 # ifconfig vlan0 vlandev cxl0 vlan 100 ifconfig: both vlan and vlandev must be specified ``` I can confirm that is regression by https://reviews.freebsd.org/D35848 , I'm preparing the patch.
Hi mike, May you please have a try with the patch in https://reviews.freebsd.org/D45283 ?
(In reply to Zhenlei Huang from comment #3) thank you so much for fixing! It does indeed work for me # patch -p1 < /tmp/if.diff Hmm... Looks like a unified diff to me... The text leading up to this was: -------------------------- |diff --git a/sbin/ifconfig/ifvlan.c b/sbin/ifconfig/ifvlan.c |--- a/sbin/ifconfig/ifvlan.c |+++ b/sbin/ifconfig/ifvlan.c -------------------------- Patching file sbin/ifconfig/ifvlan.c using Plan A... Hunk #1 succeeded at 60. Hunk #2 succeeded at 68. Hunk #3 succeeded at 158. Hunk #4 succeeded at 176. Hunk #5 succeeded at 201. Hunk #6 succeeded at 243. Hmm... Ignoring the trailing garbage. done .... (make clean,depend,,install) root@build14:/usr/src/sbin/ifconfig # ifconfig vlan10 10.1.1.1/24 vlan 10 vlandev vtnet0 root@build14:/usr/src/sbin/ifconfig # ifconfig vlan10 destroy root@build14:/usr/src/sbin/ifconfig # ifconfig vlan10 create root@build14:/usr/src/sbin/ifconfig # ifconfig vlan10 10.1.1.1/24 vlandev vtnet0 vlan 10 root@build14:/usr/src/sbin/ifconfig #
(In reply to mike from comment #4) That's good news. Thanks for the testing !
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=76df3c57a0abfd24652bfa33982ba136d9d0575b commit 76df3c57a0abfd24652bfa33982ba136d9d0575b Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-05-21 16:35:01 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-05-21 16:35:01 +0000 ifconfig: Redo fix vlan/vlanproto reconfiguration When the if_vlan(4) interface has not been fully configured, i.e., a bare interface without a physical interface associated with it, retrieving the current settings of it and unconditionally overwriting `params` will result in losing vlandev settings in `params`. That will lead to failing to associate the if_vlan(4) interface with the requested physical interface and the false report 'both vlan and vlandev must be specified'. Fix that by checking if the vlan interface has been fully configured. The basic VLAN test is slightly modified to cover this case. PR: 279181 Reviewed by: kp Tested by: Mike Tancsa <mike@sentex.net> Fixes: b82b8055ad44 ifconfig: fix vlan/vlanproto reconfiguration MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45283 sbin/ifconfig/ifvlan.c | 31 ++++++++++++++++++++++++++----- tests/sys/net/if_vlan.sh | 10 +++++++--- 2 files changed, 33 insertions(+), 8 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=c9188db6f956b30344bc99a13baf57727d4ac97a commit c9188db6f956b30344bc99a13baf57727d4ac97a Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-05-21 16:35:01 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-05-24 16:03:02 +0000 ifconfig: Redo fix vlan/vlanproto reconfiguration When the if_vlan(4) interface has not been fully configured, i.e., a bare interface without a physical interface associated with it, retrieving the current settings of it and unconditionally overwriting `params` will result in losing vlandev settings in `params`. That will lead to failing to associate the if_vlan(4) interface with the requested physical interface and the false report 'both vlan and vlandev must be specified'. Fix that by checking if the vlan interface has been fully configured. The basic VLAN test is slightly modified to cover this case. PR: 279181 Reviewed by: kp Tested by: Mike Tancsa <mike@sentex.net> Fixes: b82b8055ad44 ifconfig: fix vlan/vlanproto reconfiguration MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45283 (cherry picked from commit 76df3c57a0abfd24652bfa33982ba136d9d0575b) sbin/ifconfig/ifvlan.c | 31 ++++++++++++++++++++++++++----- tests/sys/net/if_vlan.sh | 10 +++++++--- 2 files changed, 33 insertions(+), 8 deletions(-)
It is too late to catch up with 14.1-RELEASE. The fix has been in stable/14. Closing now.