CCR2216 and CCR2116 vlans and bridges..

Upgrading older hardware/systems to new Mikrotik systems.. (almost 15 year old Dell PowerConnect equipment..)

Then I came to some systems which had native vlans (for security) defined and when I looked those up.. and I think I started to lose my mind..

After much reading.. apparently I’ve created hybrid vlans.. which is not what I wanted..

/interface ethernet set [ find default-name=sfp-sfpplus1 ] auto-negotiation=no speed=1G-baseX
/interface vlan add interface=sfp-sfpplus3 name=vlan42 vlan-id=42
/interface vlan add interface=sfp-sfpplus3 name=vlan49 vlan-id=49
/interface vlan add interface=sfp-sfpplus3 name=vlan50 vlan-id=50
/interface vlan add interface=sfp-sfpplus3 name=vlan69 vlan-id=69
/interface vlan add interface=sfp-sfpplus3 name=vlan172 vlan-id=172
/interface vlan add interface=sfp-sfpplus3 name=vlan173 vlan-id=173
/interface vlan add interface=sfp-sfpplus3 name=vlan192 vlan-id=192
/interface vlan add interface=sfp-sfpplus3 name=vlan256 vlan-id=256
/interface vlan add interface=sfp-sfpplus3 name=vlan512 vlan-id=512
/interface vlan add interface=sfp-sfpplus3 name=vlan515 vlan-id=515
/interface vlan add interface=sfp-sfpplus3 name=vlan666 vlan-id=666
/interface vlan add interface=sfp-sfpplus3 name=vlan1000 vlan-id=1000
/interface vlan add interface=sfp-sfpplus3 name=vlan1024 vlan-id=1024
/interface vlan add interface=sfp-sfpplus1 name=vlan2069 vlan-id=2069

Found these: [Using RouterOS to VLAN your network @pcunite]
http://forum.mikrotik.com/t/using-routeros-to-vlan-your-network/126489/1
http://forum.mikrotik.com/t/unable-to-have-a-very-simply-vlan-between-two-ccr2116-working/168248/1
https://help.mikrotik.com/docs/display/ROS/CRS3xx%2C+CRS5xx%2C+CCR2116%2C+CCR2216+switch+chip+features

working all weekend and not having any real success..

Q: Do I need a bridge for each (trunk) collection of tagged ports?

I saw a ton of things with mktk and ‘vlan 0’ then I read this:

A word of caution if you are thinking of using VLAN 1 in your network design. Most vendors use VLAN 1 as the native VLAN for their hardware. MikroTik uses VLAN 0. If you try to create a VLAN 1 scenario with MikroTik, and expecting tagged frames, it will be incompatible with other vendors who default VLAN 1 as untagged. Therefore, unless you are prepared to change the default behavior in MikroTik and/or other vendors, it is simpler to use VLAN 2 and higher.

(mental note) also need to block vlan0 as well?

Hybrid seems to be what Unifi does as well.. where they just pass all vlan traffic, defined, known, or unknown..

Again given this:

 flowcontrol off
 description Trunk
 spanning-tree portfast auto
 switchport mode trunk
 switchport trunk allowed vlan remove 1,3-171,173-4094

Denying vlan1, vlan3, etc from the trunk (which looks like a default allow with exceptions vs a default deny with exceptions..)

Q: how would I make a default deny all vlans except what I’ve defined on the ‘trunk/bridge’ ports?

I cannot seem to get the bridge, vlan-filtering, pvid, untagged, vlan-ids syntax correct at all.. for what I’m looking for..

When I add a second/multiple vlan things stop working..

The switch.rcs and router.rsc in post 2: http://forum.mikrotik.com/t/using-routeros-to-vlan-your-network/126489/1

Q: at the end of this.. if it’s not defined will it be denied? It seems like it.. but no one seems to talk about that..

Also by default the 2216 and 2116 only do hardware offloaded bridges.. so no need to try and enable hw=on correct?

.. and after all this set the native vlan to 666 in case something gets somewhere it shouldn’t..

.. and it seems there is no tag/label for voice vlan traffic..

@mkx @sindy @pcunite Thank you for all your work/comments on those threads..

Attached is the unifi profile for the “trunks” and vlan1 is not included.. and the local device setting for management vlan 172..

Thank you in advance for taking the time to read this..

Greatly appreciated.
BBu1aD59tf.png
EFR9fIVWVM.png

/interface bridge port add bridge=vlan-bridge frame-types=admit-only-vlan-tagged interface=sfp-sfpplus1
/interface bridge port add bridge=vlan-bridge frame-types=admit-only-vlan-tagged interface=sfp-sfpplus3

/interface bridge vlan add bridge=vlan-bridge tagged=sfp-sfpplus1 vlan-ids=2004
/interface bridge vlan add bridge=vlan-bridge tagged=sfp-sfpplus3 vlan-ids=2,42,49,50,172,192,256,512,515,1000,1024

/interface bridge add name=vlan-bridge protocol-mode=none vlan-filtering=yes
/interface ethernet set [ find default-name=sfp-sfpplus1 ] auto-negotiation=no speed=1G-baseX
/interface vlan add interface=vlan-bridge name=vlan2 vlan-id=2
/interface vlan add interface=vlan-bridge name=vlan42 vlan-id=42
/interface vlan add interface=vlan-bridge name=vlan49 vlan-id=49
/interface vlan add interface=vlan-bridge name=vlan50 vlan-id=50
/interface vlan add interface=vlan-bridge name=vlan172 vlan-id=172
/interface vlan add interface=vlan-bridge name=vlan192 vlan-id=192
/interface vlan add interface=vlan-bridge name=vlan256 vlan-id=256
/interface vlan add interface=vlan-bridge name=vlan512 vlan-id=512
/interface vlan add interface=vlan-bridge name=vlan515 vlan-id=515
/interface vlan add interface=vlan-bridge name=vlan666 vlan-id=666
/interface vlan add interface=vlan-bridge name=vlan1000 vlan-id=1000
/interface vlan add interface=vlan-bridge name=vlan1024 vlan-id=1024
/interface vlan add interface=vlan-bridge name=vlan2004 vlan-id=2004

But then:

/interface/bridge/port/export verbose 

/interface bridge port
add auto-isolate=no bpdu-guard=no bridge=vlan-bridge broadcast-flood=yes disabled=no edge=auto fast-leave=no frame-types=admit-only-vlan-tagged horizon=none hw=yes ingress-filtering=yes interface=\
    sfp-sfpplus1 !internal-path-cost learn=auto multicast-router=temporary-query mvrp-applicant-state=normal-participant mvrp-registrar-state=normal !path-cost point-to-point=auto priority=0x80 pvid=1 \
    restricted-role=no restricted-tcn=no tag-stacking=no trusted=no unknown-multicast-flood=yes unknown-unicast-flood=yes
    
add auto-isolate=no bpdu-guard=no bridge=vlan-bridge broadcast-flood=yes disabled=no edge=auto fast-leave=no frame-types=admit-only-vlan-tagged horizon=none hw=yes ingress-filtering=yes interface=\
    sfp-sfpplus3 !internal-path-cost learn=auto multicast-router=temporary-query mvrp-applicant-state=normal-participant mvrp-registrar-state=normal !path-cost point-to-point=auto priority=0x80 pvid=1 \
    restricted-role=no restricted-tcn=no tag-stacking=no trusted=no unknown-multicast-flood=yes unknown-unicast-flood=yes

where did pvid=1 come from.. and which is what I think would be the ‘native vlan’ setting.. and should be changed to 666..

I believe that to be the minimal “router” portion for filtering vlans..

Detailed network diagram will go a long way…

VLAN 1 is the default PVID as you have not specified anything different.
/interface bridge port add bridge=vlan-bridge frame-types=admit-only-vlan-tagged interface=sfp-sfpplus1 pvid=1 # implict default PVID
/interface bridge port add bridge=vlan-bridge frame-types=admit-only-vlan-tagged interface=sfp-sfpplus3 pvid=1 # implict default PVID

The setting is irrelevant as you have frame-types=admit-only-vlan-tagged

On a Mikrotik a bridge is treated as a separate subsystem, it has an implicit bridge-to-CPU interface so bridge traffic can access other services within the device but it is perfectly possible to configure a bridge which has no interaction with them. This may help http://forum.mikrotik.com/t/routeros-bridge-mysteries-explained/147832/1