Example for Configuring VLAN ID-based Selective QinQ
Networking Requirements
- Traffic in positions A and B is transmitted through the core/backbone network.
- Devices transmitting the same service are allowed to communicate, and devices transmitting different services are isolated.
Configuration Roadmap
You can configure VLAN ID-based selective QinQ to meet the preceding requirements. Production service servers communicate in VLAN 100 and office service servers communicate in VLAN 200 of the core/backbone network, and different service servers are isolated.
The configuration roadmap is as follows:
Create VLAN 100 and VLAN 200 on SwitchA and SwitchB, and configure selective QinQ on interfaces of SwitchA and SwitchB so that different VLAN tags are added to different packets of services.
Add interfaces of SwitchA and SwitchB connected to the core/backbone network to VLANs so that packets from VLAN 100 and VLAN 200 are allowed to pass through.
Procedure
- Create VLANs.
# Create VLAN 100 and VLAN 200 on SwitchA.
<HUAWEI> system-view [~HUAWEI] sysname SwitchA [*HUAWEI] commit [~SwitchA] vlan batch 100 200 [*SwitchA] commit
# Create VLAN 100 and VLAN 200 on SwitchB.
<HUAWEI> system-view [~HUAWEI] sysname SwitchB [*HUAWEI] commit [~SwitchB] vlan batch 100 200 [*SwitchB] commit
- Configure selective QinQ on interfaces.
# Configure 10GE1/0/1 on SwitchA.
[~SwitchA] interface 10ge 1/0/1 [~SwitchA-10GE1/0/1] port link-type hybrid [*SwitchA-10GE1/0/1] port hybrid untagged vlan 100 200 [*SwitchA-10GE1/0/1] port vlan-stacking vlan 10 to 30 stack-vlan 100 [*SwitchA-10GE1/0/1] port vlan-stacking vlan 31 to 50 stack-vlan 200 [*SwitchA-10GE1/0/1] quit [*SwitchA] commit
# Configure 10GE1/0/1 on SwitchB.
[~SwitchB] interface 10ge 1/0/1 [~SwitchB-10GE1/0/1] port link-type hybrid [*SwitchB-10GE1/0/1] port hybrid untagged vlan 100 200 [*SwitchB-10GE1/0/1] port vlan-stacking vlan 10 to 30 stack-vlan 100 [*SwitchB-10GE1/0/1] port vlan-stacking vlan 31 to 50 stack-vlan 200 [*SwitchB-10GE1/0/1] quit [*SwitchB] commit
- Configure interfaces of SwitchA and SwitchB connected to
the core/backbone network.
# Add 10GE1/0/2 on 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 10ge 1/0/2 [~SwitchA-10GE1/0/2] port link-type trunk [*SwitchA-10GE1/0/2] port trunk allow-pass vlan 100 200 [*SwitchA-10GE1/0/2] commit [~SwitchA-10GE1/0/2] quit
- Verify the configuration.
From a production service server in VLANs 10 to 30 in position A, ping a production service server in the same VLAN in position B. The ping operation succeeds, indicating that production service servers can communicate with each other.
From an office service server in VLANs 31 to 50 in position A, ping an office service server in the same VLAN in position B. The ping operation succeeds, indicating that office service servers can communicate with each other.
From a production service server in VLANs 10 to 30 in position A, ping an office service server in VLANs 31 to 50 in position B. The ping operation fails, indicating that services are isolated.
Configuration Files
Configuration file of SwitchA
# sysname SwitchA # vlan batch 100 200 # interface 10GE1/0/1 port link-type hybrid port hybrid untagged vlan 100 200 port vlan-stacking vlan 10 to 30 stack-vlan 100 port vlan-stacking vlan 31 to 50 stack-vlan 200 # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 100 200 # return
Configuration file of SwitchB
# sysname SwitchB # vlan batch 100 200 # interface 10GE1/0/1 port link-type hybrid port hybrid untagged vlan 100 200 port vlan-stacking vlan 10 to 30 stack-vlan 100 port vlan-stacking vlan 31 to 50 stack-vlan 200 # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 100 200 # return