How to se the Native VLANs in RouterOS and SwOS?
Strictly speaking, a "native" VLAN is the only VLAN permitted on a port classified as an "access" one, so the very name "native" only has a distinctive meaning on a "trunk" (in "Ciscoish") or "hybrid" (in "HPish") port.
Hence for SwOS, this
Trunk and Hybrid Ports section of the manual is the right place to look.
For RouterOS, the actual information that needs to be entered is the same, but the way to enter it is slightly different. There are two tables -
/interface/bridge/port, which defines the membership of interfaces in bridges as ports, and
/interface/bridge/vlan, which defines the details of membership of the bridge ports in the VLANs on their bridges.
Using the
/interface/bridge/port table, you can choose whether an Ethernet interface will be treated as a member port of some bridge or not, and if yes, the place to set the ID of the native VLAN is the
pvid column on the row in that table. This is all you need to do to add a bridge port with a native VLAN N - the addition of an interface to a bridge by means of the row in that table and setting the
pvid on that row to N automatically creates a dynamic row in the
/interface/bridge/vlan table unless it has already been present there, the
vlan-ids column of that row gets set to N, and the interface gets placed to the list in the
untagged column of that row. If the interface already has been a member of a bridge and had some native VLAN assigned, by changing the
pvid you just change the native VLAN.
If a row with
vlan-ids=N has already been present in the
/interface/bridge/vlan table for a given bridge and you make another interface a member port of the same bridge with
pvid set to N, the interface is only added to the
untagged list on that row. But if a row has been manually added for that bridge and N is just one of the VLAN IDs in the
vlan-ids list on that row, the system will not resolve such a conflict (at most one VLAN can be the native one for any given port) automatically, nor will it resolve the case when N is the only item on the
vlan-ids list of a row but the interface has been added to the
tagged list on that row.
So start from simple cases (as in "create access ports to individual VLANs"), then move to pure trunk ports (that have no native VLAN, which means you have to set
ingress-filtering to
yes and
frame-types to
admit-only-vlan-tagged on the
/interface/bridge/port row, so the
pvid column on that row will be ignored and the interface will not be added to the
untagged list of any row in
/interface/bridge/vlan, but you will have to manually add rows to
/interface/bridge/vlan and put the interface names to the
tagged lists on those rows), and finally you can set up "hybrid" ports that allow multiple VLANs to pass through, one of them "native".