[Bug 261136] ifconfig vlan option parsing is overly fussy

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 12 Jan 2022 04:10:30 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261136

            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
(https://docs.freebsd.org/en/books/handbook/advanced-networking/#network-vlan)
lists several examples which do not work in FreeBSD 13.

eg
[test13 14:34] ~ >sudo ifconfig video.5 create vlan 5 vlandev video name
cameras inet 192.168.20.20/24
ifconfig: ambiguous vlan specification
[test13 14:34] ~ >sudo ifconfig em0.5 create vlan 5 vlandev em0 inet
192.168.20.20/24
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
192.168.200.0/24
em0.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
       
options=481009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
        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 203.31.81.137 netmask 0xffffff00 broadcast 203.31.81.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
em0.5: flags=8003<UP,BROADCAST,MULTICAST> metric 0 mtu 1500
        ether 00:00:00:00:00:00
        inet 192.168.200.0 netmask 0xffffff00 broadcast 192.168.200.255
        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.