Page cover

Mikrotik QinQ VLAN trunking and policy based routing

In my GNS3 home lab, I have extended the VLAN trunking lab to the more interesting VLAN concept of VLAN Q-in-Q or 802.1ad Ethernet standard for Mikrotik devices. It can sound very complicated with the configuration on Cisco's IOS XE networking devices but it is not the case with the mighty Mikrotik's RouterOS.

In this lab, I have to rearrange the connectivity and device config a bit to align with the scenario I want to test. This kind of setup can be very common in the Metro Ethernet networks for tagging the multiple VLANs inside the primary VLAN provisioned by your provider for the uplink to WAN or the internet. Imagine that the ISP has provisioned a VLAN to extend the layer2 network from the provider edge (PE) device to the customer-premises equipment (CPE) in MPLS network. Inside that VLAN, the provider also want to tag additional VLANs to separate the data traffic from the voice traffic in order to cap the bandwidth or perform QoS on the link. The provider can utilise the IEEE 802.1ad or QinQ VLAN trunking (basically IEEE 802.1q inside the IEEE 802.1q) on Mikrotik devices. Sometimes people refer it as 802.1q tunneling in Cisco networking.

Additionally, the policy based routing has to be implemented on CPE to handle the downstream LANs for routing.

Prerequisites

  • GNS3 Emulator

  • Mikrotik CHR appliance setup on GNS3

  • Mikrotik RouterOS version 7.7

  • Basic level of comfortableness with Mikrotik RouterOS CLI and GNS3 setup

Network Topology

Mikrotik QinQ VLAN trunking
  • Provider edge (PE) router - PE is a provider's router provisioned in its core network to provide MPLS WAN connectivity or the internet service to end customers

  • Customer-premises equipment (CPE) router - CPE is a router or L3 switch installed at customer site to terminate the connectivity for MPLS or the internet service.

  • Switch (SW) - SW is a Layer2 switch to distribute the connectivity among different tenants at the same apartment or office compound.

  • Customer1 - PC1 is a customer who only subscribe for data service.

  • Customer2 - PC2 is a customer who only subscribe for voice service.

Configuration

PE router config

Here is the full configuraiton for PE router in the topoloy.

Note that the cust1_data and cust1_voice VLANs are nested to the backbone uplink VLAN 600 as configured on PE.

CPE router config

Here is the full configuration for CPE router.

As shown above, it is not that difficult to understand what is going on with QinQ VLAN trunking between upstream and downstream to manage two types of traffics on CPE. And policy based routing is required for handling two downstream LANs routing.

SW switch config

Here is the full configuration for SW switch device shown in the topology.

Testing

Customer 1 (PC1) - data subscriber test

Customer 2 (PC2) - voice subscriber test

Last updated

Was this helpful?