Example for Configuring Basic QinQ
Networking Requirements
In Figure 10-9, there are two enterprises on the network, Enterprise 1 and Enterprise 2. Both of them have two office locations, which connect to SwitchA and SwitchB of the ISP network. A non-Huawei device on the ISP network uses the TPID value of 0x9100.
- Enterprise 1 and Enterprise 2 use independent VLAN plans that do not affect each other.
- Traffic of an enterprise's branches is transparently transmitted on the ISP network. Users accessing the same service in an enterprise are allowed to communicate, and users accessing different services are isolated.
Configuration Roadmap
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 them to VLAN 100 and VLAN 200 respectively, so that packets from the two enterprises are tagged with different outer VLAN tags.
Add interfaces of SwitchA and SwitchB connected to the ISP 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 ISP network, set the TPID in outer VLAN tags to the value used on the non-Huawei device so that SwitchA and SwitchB can interwork with the non-Huawei device.
Procedure
- Create VLANs.
# 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
- Set the link type of interfaces to Dot1q-tunnel.
# Configure GE1/0/1 and GE1/0/2 on SwitchA as QinQ interfaces, and set the default VLAN of GE1/0/1 to VLAN 100 and the default VLAN of GE1/0/2 to VLAN 200. The configuration of SwitchB is similar to the configuration of SwitchA, and is not mentioned here.
[SwitchA] interface gigabitethernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] port link-type dot1q-tunnel [SwitchA-GigabitEthernet1/0/1] port default vlan 100 [SwitchA-GigabitEthernet1/0/1] quit [SwitchA] interface gigabitethernet 1/0/2 [SwitchA-GigabitEthernet1/0/2] port link-type dot1q-tunnel [SwitchA-GigabitEthernet1/0/2] port default vlan 200 [SwitchA-GigabitEthernet1/0/2] quit
- Configure the interfaces of SwitchA and SwitchB connected
to the ISP network.
# Add GE1/0/3 of SwitchA to VLAN 100 and VLAN 200. The configuration of SwitchB is similar to the configuration of SwitchA, and is not mentioned here.
[SwitchA] interface gigabitethernet 1/0/3 [SwitchA-GigabitEthernet1/0/3] port link-type trunk [SwitchA-GigabitEthernet1/0/3] port trunk allow-pass vlan 100 200 [SwitchA-GigabitEthernet1/0/3] quit
- Configure the TPID value in outer VLAN tags.
# Set the TPID value in outer VLAN tags to 0x9100 on SwitchA.
[SwitchA] interface gigabitethernet 1/0/3 [SwitchA-GigabitEthernet1/0/3] qinq protocol 9100
# Set the TPID value in outer VLAN tags to 0x9100 on SwitchB.
[SwitchB] interface gigabitethernet 1/0/3 [SwitchB-GigabitEthernet1/0/3] qinq protocol 9100
- Verify the configuration.
In Enterprise 1, ping a PC in a 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.
In Enterprise 2, ping a PC in a 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.
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.
Configuration Files
SwitchA configuration file
# sysname SwitchA # vlan batch 100 200 # interface GigabitEthernet1/0/1 port link-type dot1q-tunnel port default vlan 100 # interface GigabitEthernet1/0/2 port link-type dot1q-tunnel port default vlan 200 # interface GigabitEthernet1/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 GigabitEthernet1/0/1 port link-type dot1q-tunnel port default vlan 100 # interface GigabitEthernet1/0/2 port link-type dot1q-tunnel port default vlan 200 # interface GigabitEthernet1/0/3 qinq protocol 9100 port link-type trunk port trunk allow-pass vlan 100 200 # return