Fri Sep 09, 2022 5:00 am
To be clear, when you set your Bridge ports and assign a PVID to an interface that does a couple of things.
a. ensures packets coming into the port (from a dumb device) will get assigned the appropriate vlan tag.
b. automatically creates untagging of that port so that one does not have to manually insert the untagging on the /interface bridge vlans ( so when packet egresses the port the tag is stripped off). However this automated activity requires a not so clear rule .........
" Any vlan associated with a bridge must be identified with at least one interface on the bridge in the /interface bridge vlan settings. "
The untagging is dynamically done by the router on the fly when needed and is the reason it doesnt necessarily show on a config.
That is why I advocate always manually inserting untagging part of the config to.
a. cross-check the config at anytime between /interface bridge ports and /interface bridge vlans
b. allows any admin to quickly understand another config and to see an error in configuration.
c. ensures new users more fully understand how the config determines actual functionality.
The hardest part of the vlan configuration for most new users following the above docs, especially looking at pcunites discussion, is to understand the difference between
when that that vlan is used only for an access port or access ports, and when that vlan is also used for other trunk ports. The difference being the vlan somewhere along the line has to be tagged to an interface and if not so, it needs to be tagged to the bridge. He calls it L3 switching.............
Take for example a CAPAC, all vlans are tagged on the incoming trunk port (ether1) but none of the PVID=xx interfaces for WLAN need to be tagged to the bridge.
Why because on ether1, the WLAN vlans were tagged at least once to a port on the bridge.
This is not the case typically on the first Mikrotik device (such as a single wifi router) as there is no trunk port IN, however there may be a trunk port out where that vlan is selected and thus any associated vlans need not be noted for any untagged ports. So the confusion mainly falls on the case of one originating device and no trunk ports containing a vlan. That vlan even though untagged on all ports needs to be tagged to something at least once and in this case it would have to be the bridge.
This is explained or shown on pcunites description like so, under the example of Router+AP but its not an OBVIOUS POINT that leads to successful configs in my experience.......
# L3 switching so Bridge must be a tagged member
/interface bridge vlan
set bridge=BR1 tagged=BR1 [find vlan-ids=10]
set bridge=BR1 tagged=BR1 [find vlan-ids=20]
set bridge=BR1 tagged=BR1 [find vlan-ids=99]
What he is showing, in practical terms, is that one has to tag the bridge in the case where the vlan has not been tagged yet on any port.
The config the way I would write it would look like this......
add bridge=BR1 tagged=BR1 untagged=WLAN1 vlan-ids=10
add bridge=BR1 tagged=BR1 untagged=WLAN2 vlan-ids=20
add bridge=BR1 tagged=BR1 untagged=WLAN3 vlan-ids=99
What would also perfectly fine although ridiculous looking is this,which many members would use...... As now the vlan is associated with an interface in this case the bridge, and the router will create the untagging dynamically as determined by the /interface bridge settings........
set bridge=BR1 tagged=BR1 vlan-ids=10
set bridge=BR1 tagged=BR1 vlan-ids=20
set bridge=BR1 tagged=BR1 vlan-ids=99
To further illustrate this functionality, imagine if, for example, VLAN10 was also on a trunk port on ether2 lets say to a switch along with vlan99 the config would then look like so.......
add bridge=BR1 tagged=BR1.ether2 vlan-ids=10
add bridge=BR1 tagged=BR1 untagged=WLAN2 vlan-ids=20
add bridge=BR1 tagged=BR1.ether2 vlan-ids=99
Since the vlan has actually been tagged on another port, one no longer has to implicitly untag the associated wlan as its handled automatically/dynamically by the router.
However I personally still manually tag them so that my INTERFACE BRIDGE ports & vlans can be cross-checked more easily.
add bridge=BR1 tagged=BR1,ether2 untagged=WLAN1 vlan-ids=10
add bridge=BR1 tagged=BR1 untagged=WLAN2 vlan-ids=20
add bridge=BR1 tagged=BR1,ether2 untagged=WLAN3 vlan-ids=99