As shown in Figure 1, the network hosts two enterprises: Enterprise 1 and Enterprise 2. Each enterprise has two branches, which connect to SwitchA and SwitchB of the carrier network. A non-Huawei device on the carrier network uses the TPID value of 0x9100.
The configuration roadmap is as follows:
Create VLAN 100 and VLAN 200 on SwitchA and SwitchB. Configure interfaces connected to the two enterprises as QinQ interfaces and add the interfaces to VLAN 100 and VLAN 200, so that packets from the two enterprises are tagged with different outer VLAN tags.
Add interfaces on SwitchA and SwitchB connected to the carrier network to VLAN 100 and VLAN 200 so that packets from the two VLANs are allowed to pass through.
On the interfaces of SwitchA and SwitchB connected to the carrier network, set the TPID value in outer VLAN tags to the TPID value used on the non-Huawei device so that SwitchA and SwitchB can interoperate with the non-Huawei device.
# Create VLAN 100 and VLAN 200 on SwitchA.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 100 200
# Create VLAN 100 and VLAN 200 on SwitchB.
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] vlan batch 100 200
# Configure GE0/0/1 and GE0/0/2 on SwitchA as QinQ interfaces, and set the outer VLAN of GE0/0/1 to VLAN 100 and the outer VLAN of GE0/0/2 to VLAN 200. The configuration on SwitchB is similar to the configuration on SwitchA, and is not mentioned here.
[SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type dot1q-tunnel [SwitchA-GigabitEthernet0/0/1] port default vlan 100 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] port link-type dot1q-tunnel [SwitchA-GigabitEthernet0/0/2] port default vlan 200 [SwitchA-GigabitEthernet0/0/2] quit
# Add GE0/0/3 on SwitchA to VLAN 100 and VLAN 200. The configuration on SwitchB is similar to the configuration on SwitchA, and is not mentioned here.
[SwitchA] interface gigabitethernet 0/0/3 [SwitchA-GigabitEthernet0/0/3] port link-type trunk [SwitchA-GigabitEthernet0/0/3] port trunk allow-pass vlan 100 200 [SwitchA-GigabitEthernet0/0/3] quit
# Set the TPID value in outer VLAN tags to 0x9100 on SwitchA.
[SwitchA] interface gigabitethernet 0/0/3 [SwitchA-GigabitEthernet0/0/3] qinq protocol 9100
# Set the TPID value in outer VLAN tags to 0x9100 on SwitchB.
[SwitchB] interface gigabitethernet 0/0/3 [SwitchB-GigabitEthernet0/0/3] qinq protocol 9100
In Enterprise 1, ping a PC in any VLAN of a branch from a PC in the same VLAN of another branch. If the ping operation is successful, internal users of Enterprise 1 can communicate with each other.
In Enterprise 2, ping a PC in any VLAN of a branch from a PC in the same VLAN of another branch. If the ping operation is successful, internal users of Enterprise 2 can communicate with each other.
Ping a PC in any VLAN of Enterprise 2 from a PC in the same VLAN of Enterprise 1. If the ping operation fails, users in Enterprise 1 and Enterprise 2 are isolated.
SwitchA configuration file
# sysname SwitchA # vlan batch 100 200 # interface GigabitEthernet0/0/1 port link-type dot1q-tunnel port default vlan 100 # interface GigabitEthernet0/0/2 port link-type dot1q-tunnel port default vlan 200 # interface GigabitEthernet0/0/3 qinq protocol 9100 port link-type trunk port trunk allow-pass vlan 100 200 # return
SwitchB configuration file
# sysname SwitchB # vlan batch 100 200 # interface GigabitEthernet0/0/1 port link-type dot1q-tunnel port default vlan 100 # interface GigabitEthernet0/0/2 port link-type dot1q-tunnel port default vlan 200 # interface GigabitEthernet0/0/3 qinq protocol 9100 port link-type trunk port trunk allow-pass vlan 100 200 # return