Lars Bonnesen(lars.bonne...@gmail.com) on 2020.04.29 21:58:27 +0200: > In earlier obsd versions I have been having success with this in > hostname.vlan703 > inet 172.18.11.9 255.255.255.252 NONE vlandev em5 description VLAN703 > > On an obsd 6.6, I use the vmx device, but the syntax: > inet 172.18.11.9 255.255.255.252 NONE vlandev vmx2 description VLAN703 does > not work as expected. If I do a tcpdump, I can find the packages reaching > vmx2, but they are never passed on to vlan703 > > How to to if I have configured a trunk on a switch, I want to configure say > VLAN id 703 on a vmx device?
Between OpenBSD 6.1 and 6.2 the syntax for configuring VLAN interfaces was changed. You now have to use the 'vnetid' and 'parent' options, as well as 'up'. see ifconfig(8) and https://www.openbsd.org/faq/upgrade62.html: The vlan(4) and svlan(4) specific configuration options in ifconfig(8) and hostname.if(5) have been deprecated in favour of the generic parent and vnetid handling. The vlan, vlandev, and -vlandev options are now deprecated in favour of vnetid, -vnetid, parent, and -parent when using ifconfig(8) or in hostname.if(5) configuration files. Use of the vlan option must be replaced with vnetid. Because VLAN tag 0 is invalid according to the relevant VLAN specifications, the vnetid option does not accept 0 as a valid network identifier. To use VLAN tag 0 on the wire the vnetid can be unconfigured with -vnetid. Use of vlandev and -vlandev must be replaced with parent and -parent respectively. Unlike vlan and vlandev, vnetid and parent do not implicitly bring the vlan interface up. Similarly, the vlan option is no longer implied by the interface's minor when it is not explicitly set. ifconfig(8) no longer outputs a vlan specific status line, or separate vnetid and parent lines. The vnetid and parent lines have been merged into a single encap line containing the VLAN tag and parent information. An example of the changes to a vlan(4) configuration file and the ifconfig(8) output is below. Before the changes: # cat /etc/hostname.vlan7 vlandev em0 # vlan 7 and up are implied lladdr random # ifconfig vlan7 vlan7: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 70:a7:3a:75:da:2d index 7 priority 0 llprio 3 vlan: 7 parent interface: em0 vnetid: 7 parent: em0 status: active After the changes: # cat /etc/hostname.vlan7 vnetid 7 parent em0 up lladdr random # ifconfig vlan7 vlan7: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 60:e8:d7:0d:10:6d index 7 priority 0 llprio 3 encap: vnetid 7 parent: em0 groups: vlan status: active > And while we are at it, what if the switch is an access port? > > Regards, Lars. > --