Look at this command: # ifconfig em0.4 create vlan 2 vlandev em0 inet 10.0.0.1/24 Theoretically it should create interface 'em0.4' with VLAN '2', but it creates interface 'em0.4' with VLAN '4'. # ifconfig em0.4 em0.4: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=103<RXCSUM,TXCSUM,TSO4> ether xx:xx:xx:xx:xx:xx inet 10.0.0.1 netmask 0xffffff00 broadcast 10.0.0.255 inet6 fe80::f2de:f1ff:febd:51ae%em0.4 prefixlen 64 scopeid 0x6 nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> media: Ethernet autoselect status: no carrier vlan: 4 vlanpcp: 0 parent interface: em0 groups: vlan Is that a bug? Regards.
This is not a bug. The vlan id is taken from the device name (em0.4), it is a shortcut so you don't have to specify the vlan and vlandev parameters.
Shouldn't this be explained in man pages or FreeBSD Handbook?
How is that not a bug? vlan 2 was explicit. It is at least a POLA issue.
(In reply to Allan Jude from comment #1) One could argue that the normal unix situation of the later on the command line overrides the former that this -is- a bug, as vlan 2 was specified after vlan 4. One could also argue that ifconfig could of spit out an error of "ambigous vlan id specified". Either way this is poorly documented.