Q-in-Q Basic Port Configuration


Q-in-Q tunneling allows service providers on Ethernet access networks to extend a Layer2 Ethernet connection between two customer sites. Q-in-Q tunneling can also be used to segregate or bundle customer traffic into fewer VLANs, or different VLANs, by adding another layer of 802.1Q tags.
Q-in-Q tunneling is useful when there are overlapping VLAN IDs because the 802.1Q VLAN tags are prepended by the service VLAN tag. The L2/L3 implementation of Q-in-Q tunneling supports the IEEE 802.1ad standard.
The Q-in-Q tunneling external mode belongs to basic Q-in-Q, while the Q-in-Q tunneling internal mode belongs to selective Q-in-Q.

Configuring the Q-in-Q Tunneling Internal/External Mode

By default, Q-in-Q is disabled. User can enable it as shown below:

admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling mode
internal
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching dot1q-tunneling mode
external 
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus# 

Configuring Q-in-Q Tunneling to Map Ingress VLANs to Service VLANs

Selective Q-in-Q tunneling allows user to add different customer VLAN tags based on different service VLAN tags.

admin@XorPlus# set vlans vlan-id 100
admin@XorPlus# set vlans vlan-id 200
admin@XorPlus# set vlans vlan-id 300
admin@XorPlus# commit 
Commit OK.
Save done.
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching port-mode trunk
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching vlan members 100
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching vlan members 200
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching vlan members 300
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling mode
internal 
admin@XorPlus# set vlans dot1q-tunneling ingress t1 from untag enabled true
admin@XorPlus# set vlans dot1q-tunneling ingress t1 then customer-vlan 10
admin@XorPlus# set vlans dot1q-tunneling ingress t1 then service-vlan 100
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling 
ingress t1
admin@XorPlus# commit 
Commit OK. 
Save done.
admin@XorPlus# set vlans dot1q-tunneling ingress t2 from one-tag customer-vlan-list 20
admin@XorPlus# set vlans dot1q-tunneling ingress t2 then service-vlan 200
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling ingress t2
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling ingress t3 from one-tag customer-vlan-list 30
admin@XorPlus# set vlans dot1q-tunneling ingress t3 then service-vlan 300
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling ingress t3
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus#
admin@XorPlus# run show interface gigabit-ethernet ge-1/1/1 dot1q-tunneling
Dot1q Tunneling Mode: none, Ether Type: 0x8100
Ingress: t1
Untagged-type Enabled: true
One-tagged-type Customer Vlan: 
Double-tagged-type Service Vlan: 0
New Service Vlan: 100
New Customer Vlan: 10
Ingress: t2
Untagged-type Enabled: false
One-tagged-type Customer Vlan: 20
Double-tagged-type Service Vlan: 0
New Service Vlan: 200
New Customer Vlan: 0
Ingress: t3
Untagged-type Enabled: false
One-tagged-type Customer Vlan: 30
Double-tagged-type Service Vlan: 0
New Service Vlan: 300
New Customer Vlan: 0
admin@XorPlus# 

Configuring Q-in-Q Tunneling Egress Pop Service VLANs

Selective Q-in-Q tunneling allows user to delete different customer VLAN tags based on different service VLAN tags.

admin@XorPlus# set vlans vlan-id 100
admin@XorPlus# set vlans vlan-id 200
admin@XorPlus# set vlans vlan-id 300
admin@XorPlus# commit 
Commit OK.
Save done.
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching port-mode trunk
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching vlan members 100
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching vlan members 200
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching vlan members 300
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 100 
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling mode 
internal
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling egress t1 from customer-vlan 10
admin@XorPlus# set vlans dot1q-tunneling egress t1 from service-vlan 100
admin@XorPlus# set vlans dot1q-tunneling egress t1 then action none
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling 
egress t1
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling egress t2 from customer-vlan 20
admin@XorPlus# set vlans dot1q-tunneling egress t2 from service-vlan 200
admin@XorPlus# set vlans dot1q-tunneling egress t2 then action one
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling 
egress t2
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling egress t3 from customer-vlan 30
admin@XorPlus# set vlans dot1q-tunneling egress t3 from service-vlan 300
admin@XorPlus# set vlans dot1q-tunneling egress t3 then action one
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling 
egress t3
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus#
admin@XorPlus# run show interface gigabit-ethernet ge-1/1/1 dot1q-tunneling
Dot1q Tunneling Mode: internal, Ether Type: 0x8100
Egress: t1
Service Vlan: 100
Customer Vlan: 10
Action: Strip both tags
Egress: t2
Service Vlan: 200
Customer Vlan: 20
Action: Retain the customer vlan tag
Egress: t3
Service Vlan: 300
Customer Vlan: 30
Action: Retain the customer vlan tag
admin@XorPlus# 

Q-in-Q Configuration Example

The configuration of Q-in-Q is shown in Fig. 4-2. 
 
Figure 4-2.Q-in-Q configuration.

Configuration on Provider A

Configure VLAN 100 as the default VLAN of Gigabit Ethernet ge-1/1/1, and enable the Q-in-Q tunneling internal mode on Gigabit Ethernet ge-1/1/1.
Then, configure the untagged frames received by the port with the customer VLAN tag 30 and service VLAN tag 100.
Finally, configure the customer VLAN tag 10 frames received by the port with the service VLAN tag 100.

admin@XorPlus# set vlans vlan-id 100
admin@XorPlus# commit 
Commit OK.
Save done.
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 100 
admin@XorPlus# set vlans dot1q-tunneling ingress t1 from untag enabled true
admin@XorPlus# set vlans dot1q-tunneling ingress t1 then customer-vlan 30
admin@XorPlus# set vlans dot1q-tunneling ingress t1 then service-vlan 100
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling 
ingress t1
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling ingress t2 from one-tag customer-vlan-list 10
admin@XorPlus# set vlans dot1q-tunneling ingress t2 then service-vlan 100
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling ingress t2
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling egress t3 from customer-vlan 10
admin@XorPlus# set vlans dot1q-tunneling egress t3 from service-vlan 100
admin@XorPlus# set vlans dot1q-tunneling egress t3 then action one
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling 
egress t3
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling egress t4 from customer-vlan 30
admin@XorPlus# set vlans dot1q-tunneling egress t4 from service-vlan 100
admin@XorPlus# set vlans dot1q-tunneling egress t4 then action none
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling 
egress t4
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling mode
internal
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus# run show interface gigabit-ethernet ge-1/1/1 dot1q-tunneling
Dot1q Tunneling Mode: internal, Ether Type: 0x8100
Ingress: t1
Untagged-type Enabled: true
One-tagged-type Customer Vlan: 
Double-tagged-type Service Vlan: 0
New Service Vlan: 100
New Customer Vlan: 30
Ingress: t2
Untagged-type Enabled: false
One-tagged-type Customer Vlan: 10
Double-tagged-type Service Vlan: 0
New Service Vlan: 100
New Customer Vlan: 0
Egress: t3
Service Vlan: 100
Customer Vlan: 10
Action: Retain the customer vlan tag
Egress: t4
Service Vlan: 100
Customer Vlan: 30
Action: Strip both tags
admin@XorPlus# 

Configure VLAN 200 as the default VLAN of Gigabit Ethernet ge-1/1/2, and enable the Q-in-Q tunneling internal mode on Gigabit Ethernet ge-1/1/2.
Then, configure the untagged frames received by the port with the customer VLAN tag 30 and service VLAN tag 200.
Finally, configure the customer VLAN tag 20 frames received by the port with the service VLAN Tag 200.

admin@XorPlus# set vlans vlan-id 200
admin@XorPlus# commit 
Commit OK.
Save done.
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 200 
admin@XorPlus# set vlans dot1q-tunneling ingress t5 from untag enabled true
admin@XorPlus# set vlans dot1q-tunneling ingress t5 then customer-vlan 30
admin@XorPlus# set vlans dot1q-tunneling ingress t5 then service-vlan 200
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching dot1q-tunneling 
ingress t5
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling ingress t6 from one-tag customer-vlan-list 20
admin@XorPlus# set vlans dot1q-tunneling ingress t6 then service-vlan 200
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching dot1q-tunneling ingress t6
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling egress t7 from customer-vlan 20
admin@XorPlus# set vlans dot1q-tunneling egress t7 from service-vlan 200
admin@XorPlus# set vlans dot1q-tunneling egress t7 then action one
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching dot1q-tunneling 
egress t7
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling egress t8 from customer-vlan 30
admin@XorPlus# set vlans dot1q-tunneling egress t8 from service-vlan 200
admin@XorPlus# set vlans dot1q-tunneling egress t8 then action none
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching dot1q-tunneling 
egress t8
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching dot1q-tunneling mode
internal 
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus# run show interface gigabit-ethernet ge-1/1/2 dot1q-tunneling
Dot1q Tunneling Mode: internal, Ether Type: 0x8100
Ingress: t5
Untagged-type Enabled: true
One-tagged-type Customer Vlan: 
Double-tagged-type Service Vlan: 0
New Service Vlan: 200
New Customer Vlan: 30
Ingress: t6
Untagged-type Enabled: false
One-tagged-type Customer Vlan: 20
Double-tagged-type Service Vlan: 0
New Service Vlan: 200
New Customer Vlan: 0
Egress: t7
Service Vlan: 200
Customer Vlan: 20
Action: Retain the customer vlan tag
Egress: t8
Service Vlan: 200
Customer Vlan: 30
Action: Strip both tags
admin@XorPlus# 

Configure VLAN 100/200 as the trunk port of Gigabit Ethernet te-1/1/49, and enable the Q-in-Q tunneling internal mode.

admin@XorPlus# set interface gigabit-ethernet te-1/1/49 family ethernet-switching port-mode trunk
admin@XorPlus# set interface gigabit-ethernet te-1/1/49 family ethernet-switching vlan members 100
admin@XorPlus# set interface gigabit-ethernet te-1/1/49 family ethernet-switching vlan members 200
admin@XorPlus# set interface gigabit-ethernet te-1/1/49 family ethernet-switching dot1q-tunneling mode internal
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus# run show interface gigabit-ethernet te-1/1/49 dot1q-tunneling
Dot1q Tunneling Mode: internal, Ether Type: 0x8100

Configuration on Provider B

Configure VLAN 100 as the default VLAN of Gigabit Ethernet ge-1/1/1, and enable the Q-in-Q tunneling internal mode on Gigabit Ethernet ge-1/1/1.
Then, configure the untagged frames received by the port with the customer VLAN tag 30 and service VLAN tag 100.
Finally, configure the customer VLAN tag 10 frames received by the port with the service VLAN tag 100.

admin@XorPlus# set vlans vlan-id 100
admin@XorPlus# commit 
Commit OK.
Save done.
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 100 
admin@XorPlus# set vlans dot1q-tunneling ingress t1 from untag enabled true
admin@XorPlus# set vlans dot1q-tunneling ingress t1 then customer-vlan 30
admin@XorPlus# set vlans dot1q-tunneling ingress t1 then service-vlan 100
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling 
ingress t1
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling ingress t2 from one-tag customer-vlan-list 10
admin@XorPlus# set vlans dot1q-tunneling ingress t2 then service-vlan 100
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling ingress t2
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling egress t3 from customer-vlan 10
admin@XorPlus# set vlans dot1q-tunneling egress t3 from service-vlan 100
admin@XorPlus# set vlans dot1q-tunneling egress t3 then action one
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling 
egress t3
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling egress t4 from customer-vlan 30
admin@XorPlus# set vlans dot1q-tunneling egress t4 from service-vlan 100
admin@XorPlus# set vlans dot1q-tunneling egress t4 then action none
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling 
egress t4
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching dot1q-tunneling mode
internal 
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus# run show interface gigabit-ethernet ge-1/1/1 dot1q-tunneling
Dot1q Tunneling Mode: internal, Ether Type: 0x8100
Ingress: t1
Untagged-type Enabled: true
One-tagged-type Customer Vlan: 
Double-tagged-type Service Vlan: 0
New Service Vlan: 100
New Customer Vlan: 30
Ingress: t2
Untagged-type Enabled: false
One-tagged-type Customer Vlan: 10
Double-tagged-type Service Vlan: 0
New Service Vlan: 100
New Customer Vlan: 0
Egress: t3
Service Vlan: 100
Customer Vlan: 10
Action: Retain the customer vlan tag
Egress: t4
Service Vlan: 100
Customer Vlan: 30
Action: Strip both tags
admin@XorPlus# 

Configure VLAN 200 as the default VLAN of Gigabit Ethernet ge-1/1/2, and enable the Q-in-Q tunneling internal mode on Gigabit Ethernet 1/1/2.
Then, configure the untagged frames received by the port with the customer VLAN tag 30 and service VLAN tag 200.
Finally, configure the customer VLAN tag 20 frames received by the port with the service VLAN Tag 200.

admin@XorPlus# set vlans vlan-id 200
admin@XorPlus# commit 
Commit OK.
Save done.
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 200 
admin@XorPlus# set vlans dot1q-tunneling ingress t5 from untag enabled true
admin@XorPlus# set vlans dot1q-tunneling ingress t5 then customer-vlan 30
admin@XorPlus# set vlans dot1q-tunneling ingress t5 then service-vlan 200
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching dot1q-tunneling 
ingress t5
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling ingress t6 from one-tag customer-vlan-list 20
admin@XorPlus# set vlans dot1q-tunneling ingress t6 then service-vlan 200
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching dot1q-tunneling ingress t6
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling egress t7 from customer-vlan 20
admin@XorPlus# set vlans dot1q-tunneling egress t7 from service-vlan 200
admin@XorPlus# set vlans dot1q-tunneling egress t7 then action one
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching dot1q-tunneling 
egress t7
admin@XorPlus# commit 
admin@XorPlus# set vlans dot1q-tunneling egress t8 from customer-vlan 30
admin@XorPlus# set vlans dot1q-tunneling egress t8 from service-vlan 200
admin@XorPlus# set vlans dot1q-tunneling egress t8 then action none
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching dot1q-tunneling 
egress t8
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching dot1q-tunneling mode 
internal 
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus# run show interface gigabit-ethernet ge-1/1/2 dot1q-tunneling
Dot1q Tunneling Mode: internal, Ether Type: 0x8100
Ingress: t5
Untagged-type Enabled: true
One-tagged-type Customer Vlan: 
Double-tagged-type Service Vlan: 0
New Service Vlan: 200
New Customer Vlan: 30
Ingress: t6
Untagged-type Enabled: false
One-tagged-type Customer Vlan: 20
Double-tagged-type Service Vlan: 0
New Service Vlan: 200
New Customer Vlan: 0
Egress: t7
Service Vlan: 200
Customer Vlan: 20
Action: Retain the customer vlan tag
Egress: t8
Service Vlan: 200
Customer Vlan: 30
Action: Strip both tags
admin@XorPlus# 

Configure VLAN 100/200 as the trunk port of Gigabit Ethernet te-1/1/49, and enable the Q-in-Q tunneling internal mode.

admin@XorPlus# set interface gigabit-ethernet te-1/1/49 family ethernet-switching port-mode trunk
admin@XorPlus# set interface gigabit-ethernet te-1/1/49 family ethernet-switching vlan members 100
admin@XorPlus# set interface gigabit-ethernet te-1/1/49 family ethernet-switching vlan members 200
admin@XorPlus# set interface gigabit-ethernet te-1/1/49 family ethernet-switching dot1q-tunneling mode internal
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus# run show interface gigabit-ethernet te-1/1/49 dot1q-tunneling
Dot1q Tunneling Mode: internal, Ether Type: 0x8100
admin@XorPlus# 

Copyright © 2024 Pica8 Inc. All Rights Reserved.