Example for Configuring Selective QinQ and VLAN Mapping
Networking Requirements
In Figure 10-11, Internet access, IPTV, and VoIP services are provided for users through home gateways.
The corridor switches allocate VLANs to the services as follows:
- VLANs for the Internet access service of different users: VLAN 1000 to VLAN 1100
- Shared VLAN for the IPTV service: VLAN 1101
- Shared VLAN for the VoIP service: VLAN 1102
- Shared VLAN for home gateways: VLAN 1103
Each community switch is connected to 50 downstream corridor switches, and maps VLAN IDs in packets of the Internet access service from the corridor switches to VLANs 101-150.
The aggregation switch of the carrier is connected to 50 downstream community switches, and adds outer VLAN IDs 21-70 to packets sent from the community switches.
Configuration Roadmap
The configuration roadmap is as follows:
Create VLANs on SwitchA and SwitchB.
Configure VLAN mapping on SwitchB and add GE 1/0/0 and GE 2/0/0 to VLANs.
Configure selective QinQ on SwitchA and add GE 1/0/0 to VLANs.
Add other downlink interfaces of SwitchA and SwitchB to VLANs. The configurations are similar to the configurations of GE 1/0/0 interfaces, and are not mentioned here.
Configure other community switches. The configuration is similar to the configuration of SwitchB, and is not mentioned here.
Procedure
- Configure SwitchA.
# Create VLANs.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 21 to 70 1101 to 1103
# Add downlink interface gigabitethernet 1/0/0 to VLANs.
[SwitchA] interface gigabitethernet 1/0/0 [SwitchA-GigabitEthernet1/0/0] port link-type hybrid [SwitchA-GigabitEthernet1/0/0] port hybrid untagged vlan 21 [SwitchA-GigabitEthernet1/0/0] port hybrid tagged vlan 1101 to 1103 [SwitchA-GigabitEthernet1/0/0] quit
# Configure selective QinQ on gigabitethernet 1/0/0.
[SwitchA] interface gigabitethernet 1/0/0 [SwitchA-GigabitEthernet1/0/0] port vlan-stacking vlan 101 to 150 stack-vlan 21 [SwitchA-GigabitEthernet1/0/0] quit
- Configure SwitchB.
# Create VLANs.
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] vlan batch 101 to 150 1000 to 1103
# Add interfaces to VLANs.
[SwitchB] interface gigabitethernet 1/0/0 [SwitchB-GigabitEthernet1/0/0] port link-type hybrid [SwitchB-GigabitEthernet1/0/0] port hybrid tagged vlan 101 1000 to 1103 [SwitchB-GigabitEthernet1/0/0] quit [SwitchB] interface gigabitethernet 2/0/0 [SwitchB-GigabitEthernet2/0/0] port link-type hybrid [SwitchB-GigabitEthernet2/0/0] port hybrid tagged vlan 101 to 150 1101 to 1103 [SwitchB-GigabitEthernet2/0/0] quit
# Configure VLAN mapping on downlink interface gigabitethernet 1/0/0.
[SwitchB] interface gigabitethernet 1/0/0 [SwitchB-GigabitEthernet1/0/0] port vlan-mapping vlan 1000 to 1100 map-vlan 101 [SwitchB-GigabitEthernet1/0/0] quit
- Verify the configuration.
The Internet access service, IPTV service, and VoIP service are available.
Configuration Files
SwitchA configuration file
# sysname SwitchA # vlan batch 21 to 70 1101 to 1103 # interface GigabitEthernet1/0/0 port link-type hybrid port hybrid tagged vlan 1101 to 1103 port hybrid untagged vlan 21 port vlan-stacking vlan 101 to 150 stack-vlan 21 # return
SwitchB configuration file
# sysname SwitchB # vlan batch 101 to 150 1000 to 1103 # interface GigabitEthernet1/0/0 port link-type hybrid port hybrid tagged vlan 101 1000 to 1103 port vlan-mapping vlan 1000 to 1100 map-vlan 101 # interface GigabitEthernet2/0/0 port link-type hybrid port hybrid tagged vlan 101 to 150 1101 to 1103 # return