拓扑图

灵活QinQ_抓包

配置

sysname AR1
#
interface GigabitEthernet0/0/0.10
 dot1q termination vid 10
 ip address 12.1.1.1 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/0.20
 dot1q termination vid 20
 ip address 21.1.1.1 255.255.255.0 
 arp broadcast enable
#
sysname AR2
#
interface GigabitEthernet0/0/0.10
 dot1q termination vid 10
 ip address 12.1.1.2 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/0.20
 dot1q termination vid 20
 ip address 21.1.1.2 255.255.255.0 
 arp broadcast enable
#
sysname SW1
#
vlan batch 100 200
#
interface GigabitEthernet0/0/1
 qinq vlan-translation enable
 port hybrid untagged vlan 100 200
 port vlan-stacking vlan 10 stack-vlan 100
 port vlan-stacking vlan 20 stack-vlan 200
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
sysname SW2
#
vlan batch 100 200
#
interface GigabitEthernet0/0/1
 qinq vlan-translation enable
 port hybrid untagged vlan 100 200
 port vlan-stacking vlan 10 stack-vlan 100
 port vlan-stacking vlan 20 stack-vlan 200
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#

结果查看

AR1 ping AR2,可以ping通

灵活QinQ_抓包_02

在SW2的G0/0/2口抓包,可以看到VLAN10的外层VLAN为100,VLAN20的外层VLAN为200

灵活QinQ_抓包_03

灵活QinQ_抓包_04