Use a bridge with vlan-filtering=no. You can configure specific VLANs on the hardware-offloaded ports ether1-ether5, however the software bridged ports will pass all tagged and untagged traffic.
You can restrict VLANs between the switch chip and the software bridge by configuring the switch1 cpu switch port, however the one thing you cannot do is exclude a VLAN to/from the SFP port if said VLAN is required by the Mikrotik itself to provide any services.
If hEX PoE has to interact with any of VLANs, use interfaces bridge-v100 and bridge-v200 (as you surely know, each bridge implicitly contains also port with same name, its functionality is similar to switch1-cpu port on switch chip).
The “bridge per vlan” approach avoids problems mentioned by @tdw.
Is there any other way of using switch chip to deal with VLANs on RJ45 ports and use SFP port as VLAN-aware port bridged to RJ45 ports at the same time?
You’re right that using VLAN bridges can potentially cause some problems and OP should be aware of them. It’s up to OP to decide, whether performance drop/boost is worth of complication (compared to using single bridge with vlan-filtering enabled and switch chip setup removed).
Hey,
I say wow, these answers came very quickly, did not expect that. Thank you very much.
I need some silent hours to process and read the written and referenced content.
I’ll try to explain what I understand as separated answer as different things are mentioned here
The SPF is the uplink so I expect only allowed VLANs are sent from the uplink to the SFP.
I’m correctly understanding that you are saying I cannot add the following to the configuration above?
space is very rare but I might be able to supply the connected APs with an external power supply in a not to far feature, So I could replace it by an hEX S
Doing so depends if the limit will be hit at all:
.
.
but my setup does not contain any loops, my network topology is 100% cascading. The structure of VLAN on a bridge in a bridge - Layer2 misconfiguration - RouterOS - MikroTik Documentation would be closer but still different but the sketch helps quite a lot to understand the configuration given by mkx .
As I understood most issues are related to the fact, that frames are sent tagged but should be untagged to be compliant with international standards.
What you do here is basically “softwiring” port to port. The is a “softwire” per VLAN.
The sketch most likely may explain it better.
I cannot find that much documentation on this approach as Bridge-VLAN-Filtering is always recommended (for good reason).
In this configuration ROS switches frames according to the 802.1Q tag to the corresponding VLAN interface, doesn’t it?
If an interface does not exist, the frame is dropped.
(Just) for curiosity, how would I handle untagged frames?
You don’t find any documentation about this way of configuring things because the bridge with vlan-filtering is here since years ago … IIRC it was 6.40 that brought VLAN-aware bridge making shown config method disadvised (to put it mildly). Previously this was tge only way of doing VLANs on anything apart from switch chip and even then there existed devices without switch chip (e.g. CCR1xxx devices except early CCR1009 model). Using vlan-filtering on bridge is much more elegant and simplifies configuration.
The way vlan interface works is the following: one creates vlan interface with command /interface vlan add interface= name= vlan-id= and has two ends; the tagged end (the red part) and untagged one (the green part). When tagged end sees frame, tagged with correct VID, it takes frame, strips the VLAN header and ejects it on untagged end. It ignores frames with wrong VID. In the other direction, it takes frame on the untagged end, adds VLAN header with configured VID and spits it out on tagged end. The underlying interface is (or can be) completely VLAN-unaware.
The problem with untagged frames is that AFAIK there isn’t an interface that only accepts untagged frames so you can’t construct anything analogous to bridge-per-vlan. Hybrid interface can be used directly for L3 because L3 can only work with untagged frames (and ignores tagged ones) but I don’t think you can bridge them without creating a bypass for tagged frames.
Reagrding post #9:
Setting frame-types= and the defintions in /interface bridge vlan have no effect when the bridge has vlan-filtering=no.
As noted in the documentation “On QCA8337 and Atheros8327 switch chips, a default vlan-header=leave-as-is property should be used. The switch chip will determine which ports are access ports by using the default-vlan-id property. The default-vlan-id should only be used on access/hybrid ports to specify which VLAN the untagged ingress traffic is assigned to.”
You cannot set vlan-filtering=yes as this is what disables the hardware offload to the switch chip, the results of mixing a VLAN-aware bridge and configuring the switch chip is not defined.
thx for all the details explanation. I would like to continue the clarification as it could be useful in certain scenarios although challenging to manage if the amount of VLAN increases significantly.
but the configuration discussed here would not cause problems as described in Layer2 misconfiguration - RouterOS - MikroTik Documentation, wouldn’t it?
The VLAN tagged/untagged is simple&controlled (only between VLAN interfaces) and is only point2point (interface2interface), like a VLAN-aware patch cable.
.
.
Is there an interface besides the VLAN interface what is VLAN-aware?
In the case of “vlan-filtering on bridge” it is the vlan-filtering what makes the interface VLAN-aware.
.
.
by assigning an IP to a hardware Interface and than route it?
.
.
bypass is bridge-v100 bridge-200?
.
.
could be handled by creating a “PVID=1-VLAN-Interface” like in sketch below?
the “bridge per vlan” certainly does have a few shortcomings. Whether they will cause problems for your particular use case or not … is up to dilligent examination. And many of potential problems also depend on equipment connected to your device, some can trip the problem, some can survive.
Legacy wireless drivers (as opposed to the new wifiwave2 drivers) take parameters to deal with vlan tags (vlan-mode and vlan-id) … if configured thus, nowdays such wifi interface had to be set as tagged port member of bridge.
Example of problems with hybrid setup: let’s say you have two hybrid ports, sfp1 and sfp2. Sfp1 has untagged snd tagged vlans 10 and 20. Sfp2 has untagged and tagged vlan 10 (but not vlan 20). If you bridge both ports with a bridge directly (because you want to bridge the untagged frames), also tagged frames will pass via this bridge. The vlan bridges will be selective due to using vlan interfaces between interfaces and corresponding bridges. And besides, this kind of solution would be wrong because physicsl interface can either be bridge port or can be used as anchor for vlan interfaces (etc.), but not both, so your diagram with bridge-v1 spanning sfp1 and be-v1 is not valid.
You can’t connect things as per last diagram, because be-v100 and be-v200 are connected to bridge with untagged ends.
ok, thx was curious if it could optimize
Thought of a theoretical case like
or my hAP ac3 where I want to at wire-speed between ports but wondered how to get the WLAN interfaces included:
but that is answered now
There are two ways to do it with vlan-enabled bridge:
bridge port tags traffic:
/interface wireless
set [ find name=wlan1 ] vlan-mode=no-tag
/interface bridge port
add bridge=bridge interface=wlan1 frame-types=admit-only-untagged-and-priority-tagged pvid=666
/interface bridge vlan
set [ find vlan-id=666 ] untagged=wlan1<,rest_of_untagged_ports>
wireless driver tags traffic:
/interface wireless
set [ find name=wlan1 ] vlan-mode=use-tag vlan-id=666
/interface bridge port
add bridge=bridge interface=wlan1 frame-types=admit-only-vlan-tagged
/interface bridge vlan
set [ find vlan-id=666 ] tagged=wlan1<,rest_of_tagged_ports>
The way #1 is onky possible with vlan-filtering enabled on bridge. The way #2 is also possible if bridge doesn’t do anything about vlans which was up to ROS version 6.40 or there about.
The way #1 is the contemporary way of doing it, wifiwave2 drivers don’t support tagging any more so I guess with time #2 will be gone.
However, on my audience running 7.2 the working config is #3:
/interface/wifiwave2
# nothing here, wifiwave2 drivers don't have any vlan-related settings
/interface bridge port
add bridge=bridge interface=wifi1 frame-types=admit-only-vlan-tagged pvid=666
/interface bridge vlan
set [ find vlan-id=666 ] tagged=wlan1<,rest_of_tagged_ports>
It doesn’t work without pvid set on bridge port. And doesn’t work if frame-types=admit-only-untagged-and-priority-tagged pvid=666 on bridge/port and wifi1 made member of untagged ports members of corresponding vlan. VLAN setup for ether ports work according to expectations. I’ve open a support ticket and waiting patiently for any kind of response.
it is a shame that #2 is not supported by wifiwave2 as that is the only option to allow hardware vlan switching through the switch chip and including the WLAN interfaces to the corresponding bridge (in case of e.g. hAP ac3)
I hope that more switch chip types will receive HW offload from bridge. Just like RTL8367 and MT7621 did with ROS 7.1. As most wifiwave2 devices currently run off QCA wifi chips, I guess that HW offload to AR8327/QCA8337 would solve the problem you mentioned.