CRS with RouterOS vlan stacking (QinQ)

Hi Mikrotik guys,
I can’t find relevant information about this. Can someone please make it clear if it’s possible to have QinQ vlan stack, with 0x8100 double tagging in the switch chip, on CRS with routerOS like:

  • CRS106-1C-5S
  • CRS212-1G-10S-1S+IN
  • CRS226-24G-2S+RM

You can set both customer-vid and service-vid in switch → vlan
I think that is what you need. I have never tried service-vid. And customer-vid seems to be buggy as showed in this thread:
http://forum.mikrotik.com/t/solved-cloud-router-hub-125/107325/1

Vlan stack with double 0x8100 tag.

Example 100 outer tag 123 inner tag.
Enable switch port

/interface ethernet
set [ find default-name=combo1 ] name=combo1-master
set [ find default-name=sfp1 ] master-port=combo1-master

Tag the outer vlan.

/interface ethernet switch egress-vlan-tag
add tagged-ports=sfp1 vlan-id=100

Add outer vlan to a tagged port.

/interface ethernet switch ingress-vlan-translation
add customer-vid=123 new-service-vid=100 ports=sfp2

Add outer and inner vlan (acces port)

/interface ethernet switch ingress-vlan-translation
add customer-vid=0 new-customer-vid=123 new-service-vid=100 ports=sfp3
/interface ethernet switch egress-vlan-translation
add customer-vid=123 new-customer-vid=0 ports=sfp3

O&M interface.

/interface vlan
add interface=combo1-master name=vlan123 vlan-id=123
/ip address
add address=192.168.123.123/24 interface=vlan123 network=192.168.123.0
/interface ethernet switch egress-vlan-tag
add tagged-ports=switch1-cpu vlan-id=123
/interface ethernet switch ingress-vlan-translation
add customer-vid=123 new-service-vid=100 ports=switch1-cpu

Set to do forwarding according to outer VLAN id

/interface ethernet switch
set bridge-type=service-vid-used-as-lookup-vid

Configure TPID (service, outer tag) settings on QinQ port where double tagged packets are sent and received.

/interface ethernet switch port
set sfp1 egress-service-tpid-override=0x8100 ingress-service-tpid-override=0x8100

Hi,

I’ve been investigating this issue earlier and I’m actually back on this topic once again since I now need 10G upgrade to my original setup. I tried to set it up on CRS226 and I’m not sure if CRS can even be configured that way: having mixed VLANs - single and double tagged (stacked). I can get it working either one way or another, but not for both. Does anybody know if it’s possible to configure CRS to have a both types of VLANs on trunk port?

For example..

On sfp1 I receive:
VLAN 1001(outter) - VLAN 101, 102, 103 (inner);
VLAN 1002 (only single tagged);
VLAN 1003 (only single tagged).

And I need to:
Strip tag 1001 and forward tagged VLANs 101, 102, 103 to ether2;
Leave tag 1002 and 1003 and forward tagged VLAN 1002, 1003 on ether3.

Just to update the above example. It makes reference to sfp3 which is not in the diagram and can cause confusion.

In the below, pretty much the same thing.

VLAN 3081 is outer vlan
VLAN 101 is inner
ether23 is access (untagged) vlan101
sfp is tagged vlan3081 (outer) and tagged vlan101 (inner)

/interface ethernet switch egress-vlan-tag
add tagged-ports=sfp1 vlan-id=3081



/interface ethernet switch egress-vlan-translation
add customer-vid=101 new-customer-vid=0 ports=ether24



/interface vlan
add interface=combo1-master name=vlan101 vlan-id=101


/interface ethernet switch egress-vlan-tag
add tagged-ports=switch1-cpu vlan-id=101


/interface ethernet switch ingress-vlan-translation

add customer-vid=101 new-service-vid=3081 ports=sfp1
add customer-vid=0 new-customer-vid=101 new-service-vid=3081 ports=ether23
add customer-vid=101 new-service-vid=3081 ports=switch1-cpu



/interface ethernet switch
set bridge-type=service-vid-used-as-lookup-vid


/interface ethernet switch port
set sfp1 egress-service-tpid-override=0x83081 ingress-service-tpid-override=0x83081

After some work, I managed to get the VLAN QinQ to work on a CRS106 running the latest stable version of RouterOS 6.46.6 If You can make it better, please let me know!

I also managed to get a loopback within a management VLAN working, but I can’t seem to get “Drop if VLAN Not Set” to work :slight_smile: If I enable it or unselect “Forward Invalid VLAN”… it breaks.
Note, The other side of the link is a CCR1016 using Service Tag on the outer VLAN.

902 = Outer VLAN
100 = Management VLAN with Loopback IP
101 = Customer VLAN 1
102 = Customer VLAN 2

One can drop tag to the customer if you add

new-customer-vid=0

to the egress-vlan-translation config port.

# model = CRS106-1C-5S
/interface bridge
add name=bridge1
/interface vlan
add interface=bridge1 name=lo0 vlan-id=100
/interface ethernet switch
set bridge-type=service-vid-used-as-lookup-vid
/interface bridge port
add bridge=bridge1 interface=combo1
add bridge=bridge1 interface=sfp1
add bridge=bridge1 interface=sfp2
/interface ethernet switch egress-vlan-tag
add tagged-ports=combo1 vlan-id=920
/interface ethernet switch egress-vlan-translation
add customer-vid=101 customer-vlan-format=tagged ports=sfp1 service-vid=920 service-vlan-format=tagged
add customer-vid=102 customer-vlan-format=tagged ports=sfp2 service-vid=920 service-vlan-format=tagged
add customer-vid=100 customer-vlan-format=tagged ports=switch1-cpu service-vid=920 service-vlan-format=tagged
/interface ethernet switch ingress-vlan-translation
add new-customer-vid=101 new-service-vid=920 ports=sfp1
add new-customer-vid=102 new-service-vid=920 ports=sfp2
add new-customer-vid=100 new-service-vid=920 ports=switch1-cpu
/ip address
add address=10.0.0.6/30 interface=lo0 network=10.0.0.4