Q-in-Q Vlan Translation for Juniper

In networks where end-users determine the vlan-id’s to be ran across your backbone network with a possibility that these vlans-id’s will clash, Q-in-Q vlan translation is the solution for you.

Q-in-Q vlan translation allows you bundle end-user vlans into a single vlan giving you the power to determine what vlan-id to use without requesting the end-users to change their vlan-id schemes.

With Q-in-Q vlan translation, the end-user id’s are not critical and this is what makes it a very suitable solution for service providers.

This configuration solution was done on a Juniper Ex 2200 switch.

Set the switch to be aware of the Q-in-Q vlan translation
set ethernet-switching-options dot1q-tunneling ether-type 0x8100

Set the Q-in-Q vlan translation vlan – Vlan ID ‘1049’ named ‘qinqvlan’
set vlans qinqvlan vlan-id 1049

Attach the enduser interface and backbone facing interface to the Q-in-Q vlan translation vlan
set vlans qinqvlan interface ge-0/1/0.0
set vlans qinqvlan interface ge-0/0/22.0

Attach the end-user vlan in this case ‘187’ to the Q-in-Q vlan translation vlan definition
set vlans qinqvlan dot1q-tunneling customer-vlans 187

On the interface ge-0/0/22 facing the end-user, run the command push on input and pop on output.
set interfaces ge-0/0/22 unit 0 input-vlan-map push
set interfaces ge-0/0/22 unit 0 output-vlan-map pop

Make the interface ge-0/0/22 facing the end-user an access port. This is key for the Q-in-Q vlan translation solution to identify the end-user facing interface.
set interfaces ge-0/0/22 unit 0 family ethernet-switching port-mode access

Attach the Q-in-Q vlan translation vlan.
set interfaces ge-0/0/22 unit 0 family ethernet-switching vlan members 1049

Make the interface ge-0/1/0 facing the network backbone a trunk port. This is key for the Q-in-Q vlan translation solution to identify the backbone facing interface.
set interfaces ge-0/1/0 unit 0 family ethernet-switching port-mode trunk
Attach the Q-in-Q vlan translation vlan.
set interfaces ge-0/1/0 unit 0 family ethernet-switching vlan members 1049