Yes, yes, I’ve read everyone’s threads, comments, tutorials, videos, explanations, etc.
No, really, I have.
For example, this thread is great:
http://forum.mikrotik.com/t/vlan-tutorial-understanding-menu-interface-bridge-vlan/164722/1
But, you all might not like it, and I’m not claiming to be an subject matter expert on VLANS (for sure), but I am quite good at communicating, explaining, and conceptualizing how others can grasp concepts.
After many decades of near-continuous learning in one form or another, I have also (justifiably) concluded that if I’m not understanding, many (many) others are not understanding also.
So, before I proceed I want to state that I truly have enormous respect for everyone here who has a deep understanding and mastery of VLANS. I mean no disrespect whatsoever. That said, it is clear to me that the way VLANs are explained has been less than easy to comprehend.
I have taken quotes and writings from various threads here and written the explanation below. I am certain that there are errors. I am certain that there are many ommissions. I am asking that people who know more than me help me make this a better summary. My hope is that together we can come up with a way to explain how Mikrotik VLANs work. Yes, I know it has been done many many times. I have watched the videos and read the tutorials. And I know this is a complex topic. And yet myself and many others come here (and I’m sure this goes on elsewhere also) begging for help because of of being in a state of massive vlan-confusion.
So, can the experts here please read this and let me know what I got wrong?
I will then attempt to incorporate those comments into a wordy, verbose, excessive, and long-winded but hopefully clear and helpful document that others (and myself) will find helpful.
Here goes:
\
- ADD BRIDGE:
“/interface/bridge add” creates a bridge with one or two roles (sometimes the word used is “personality”): (1) Switch-like and/or (2) bridge-between-CPU-and-switch (understood as #2 role when property includes “interface,” “tagged,” or “untagged”).
Why we need to consider these roles or personalities as distinct is unclear.
Properties of this command include:
vlan-filtering is a property that effectively turns on VLAN recognition on the bridge and between bridge and switch (within the single device).
Properties that define the interfaction between CPU and switch are: admin-mac, ingress-filtering, frame-types, pvid
These apply only to the bridge port connecting to CPU, they don’t affect other (explicitly configured) ports.
Bridge interface has to be explicitly configured under bridge vlan as VLAN member according to how CPU needs to interact with network.
2) DEFINE BRIDGE PORTS:
/interface/bridge/port defines ingress behavior and adds physical (and some types of logical) interfaces to a bridge.
The properties that define port behavior for ingress frames include:
frame-types: defines what kind of frames can pass port on ingress.
If “frame-types” is set to admit-only-tagged, then untagged frames are dropped on ingress.
If “frame-types” is set to admit-only-untagged-and-priority-tagged, then any VLAN-tagged frames will be dropped on ingress, and, untagged frames will be tagged with the pvid.
If “frame-types” is set to admit-any, then no frames will be dropped on ingress.
If port has ingress-filtering=yes, then port will check the value of VLAN-ID for ingress frames against contents of VLAN table which is constructed in /interface/bridge/vlan section and then act according to check result.
A side note: every port has PVID set with default value of PVID=1. However, pvid=1 is not shown in an export, but it will show using “print”. An export will show when non-default settings are used. But it’s only used if untagged frames are allowed on ingress. And this default setting is the reason for discouraging use of VID=1 for tagged traffic – that is, it’s only too easy to forget about untagged dedault and then VLAN subnet integrity is compromised.
3) MAKE BRIDGE VLAN TABLE:
“/interface bridge vlan” determines which frames can leave (egress) the router by creating a VLAN table in which each configured vlan-id has a list of member ports.
Frames can only egress through a port which is a member of its vlan-id.
If port is “tagged member,” then VLAN tag will stay attached on egress.
If port is an “untagged member,” then VLAN tag will be stripped on egress.
The “tagged” and “untagged” properties of the command identify which ports are “tagged members” and which are “untagged members” for the specified vlan-id.
If port has property ingress-filtering=yes set, then port will only allow frames to pass on ingress if port is member of corresponding VLAN in this config section
each VLAN member port can either be tagged or untagged member.
If port has frame-types set to admit-only-untagged-and-priority-tagged or admit-all in bridge port section, then that port will be automatically added as an untagged port to the VLAN row (withing the table) with VID equal to the PVID of port (as set in /interface/bridge/port).
For example:
“/interface bridge vlan add bridge=bridge tagged=ether1 untagged=bridge vlan-id=10”
means that bridge will allow frames with vlan-id=10 to leave the router through ether1 with its vlan tag intact. And, will allow vlan-id=1- frames to egress the router on the bridge port after it strips the vlan tag.
Another example:
“/interface bridge vlan add bridge=BR1 tagged=ether1 untagged=BR1 vlan-ids=42”
means that the bridge named “BR1” will act as a bridge between switch and cpu where ether1 is a tagged member of vlan-id=42, and BR1 is an untagged member of vlan-id=42