[Bug 261136] ifconfig vlan option parsing is overly fussy

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 12 Jan 2022 04:10:30 UTC

            Bug ID: 261136
           Summary: ifconfig vlan option parsing is overly fussy
           Product: Base System
           Version: 13.0-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: darius@dons.net.au

The VLAN chapter of the handbook
lists several examples which do not work in FreeBSD 13.

[test13 14:34] ~ >sudo ifconfig video.5 create vlan 5 vlandev video name
cameras inet
ifconfig: ambiguous vlan specification
[test13 14:34] ~ >sudo ifconfig em0.5 create vlan 5 vlandev em0 inet
ifconfig: ambiguous vlan specification

I attempted to be clever with this:

[test13 14:31] ~ >sudo ifconfig vlan create name em0.5 vlandev em0 vlan 5

However ifconfig shows that it did not assign the vlandev or vlan:
[test13 14:31] ~ >ifconfig
em0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:0c:29:6c:45:cd
        inet6 fe80::20c:29ff:fe6c:45cd%em0 prefixlen 64 scopeid 0x1
        inet6 2001:44b8:1d2:8900:20c:29ff:fe6c:45cd prefixlen 64 autoconf
        inet netmask 0xffffff00 broadcast
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
em0.5: flags=8003<UP,BROADCAST,MULTICAST> metric 0 mtu 1500
        ether 00:00:00:00:00:00
        inet netmask 0xffffff00 broadcast
        inet6 fe80::20c:29ff:fe6c:45cd%em0.5 prefixlen 64 tentative scopeid 0x3
        groups: vlan
        vlan: 0 vlanproto: 0x0000 vlanpcp: 0 parent interface: <none>
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

The only working way I have found is as follows:
ifconfig vlan0 create
ifconfig vlan0 name em0.5
ifconfig em0.5 vlan 5 vlandev em0

Looks like this was broken by c7cffd65c5d858425e90b847d2e8e583e3b13bf7

You are receiving this mail because:
You are the assignee for the bug.