Example for Configuring 802.1p Priority-based VLAN Mapping
Networking Requirements
As shown in Figure 8-5, common Internet access users (using PCs) and VoIP users (using VoIP terminals) connect to the carrier network through PE1 and PE2 and communicate with each other through the carrier network.
In enterprise A, VLAN 50 is allocated to VoIP terminals and VLAN 51 is allocated to PCs. The default priority is 0.
- Traffic between two branches of enterprise A is transparently transmitted through the public network, users using the same service in different branches of enterprise A are allowed to communicate, and users using different services must be isolated.
- On an enterprise branch, voice services are transmitted preferentially, and the priority of data services remains unchanged.
Configuration Roadmap
The configuration roadmap is as follows:
VLAN mapping or dot1q tunnel can meet the preceding requirements. You can configure the dot1q tunnel function on the CE connected to the PE and implement communication between two branches of enterprise A through VLAN 20 provided by the carrier, and configure VLAN mapping on the user-side interface of CE2 to map a higher priority for voice services and a lower priority for data services.
Create a bridge group and add a sub-interface to the bridge group.
Configure VLANs allowed by a sub-interface.
Configure the user-side interface on CE2 to map the 802.1p priority of voice services from 0 to 7 so that voice services are transmitted preferentially.
Configure dot1q tunnel on the CE interface connected to the PE so that the CE can add the S-VLAN tag to user packets.
Add interfaces of the PE and P to VLAN 20 so that packets from VLAN 20 are allowed to pass through.
Procedure
- Create a bridge group and add a sub-interface to the bridge group.
<Huawei> system-view [Huawei] sysname CE1 [CE1] bridge 1 [CE1-bridge1] quit [CE1] interface gigabitethernet 0/0/0.1 [CE1-GigabitEthernet0/0/0.1] bridge 1 [CE1-GigabitEthernet0/0/0.1] bridge vlan-transmit enable [CE1-GigabitEthernet0/0/0.1] quit [CE1] interface gigabitethernet 0/0/1.1 [CE1-GigabitEthernet0/0/1.1] bridge 1 [CE1-GigabitEthernet0/0/1.1] bridge vlan-transmit enable [CE1-GigabitEthernet0/0/1.1] quit [CE1] interface gigabitethernet 0/0/2.1 [CE1-GigabitEthernet0/0/2.1] bridge 1 [CE1-GigabitEthernet0/0/2.1] bridge vlan-transmit enable [CE1-GigabitEthernet0/0/2.1] quit
The configuration of CE2 is similar to that of CE1, and is not mentioned here.
- Configure VLANs allowed by a sub-interface.
# Configure VLANs allowed by a sub-interface on the CE1.
[CE1] interface gigabitethernet 0/0/0.1 [CE1-GigabitEthernet0/0/0.1] vlan allow-pass vid 50 to 51 [CE1-GigabitEthernet0/0/0.1] quit [CE1] interface gigabitethernet 0/0/1.1 [CE1-GigabitEthernet0/0/1.1] vlan allow-pass vid 50 [CE1-GigabitEthernet0/0/1.1] quit [CE1] interface gigabitethernet 0/0/2.1 [CE1-GigabitEthernet0/0/2.1] vlan allow-pass vid 51 [CE1-GigabitEthernet0/0/2.1] quit
The configuration of CE2 is similar to that of CE1, and is not mentioned here.
- Configure GE0/0/1 on CE2 to map the 802.1p priority of voice services from 0 to 7.
[CE2] interface gigabitethernet 0/0/1.1 [CE2-GigabitEthernet0/0/1.1] vlan mapping 8021p 0 map-8021p 7 [CE2-GigabitEthernet0/0/1.1] quit
- Configure CE1 interface connected to the PE to add a VLAN tag to user packets.
[CE1] interface gigabitethernet 0/0/0.1 [CE1-GigabitEthernet0/0/0.1] vlan dot1q-tunnel 20 [CE1-GigabitEthernet0/0/0.1] quit
The configuration of CE2 is similar to that of CE1, and is not mentioned here.
- Add GE0/0/0 and GE0/0/1 on PE1 to VLAN 20 in trunk mode.
<Huawei> system-view [Huawei] sysname PE1 [PE1] vlan batch 20 [PE1] interface gigabitethernet 0/0/0 [PE1-GigabitEthernet0/0/0] port link-type trunk [PE1-GigabitEthernet0/0/0] port trunk allow-pass vlan 20 [PE1-GigabitEthernet0/0/0] quit [PE1] interface gigabitethernet 0/0/1 [PE1-GigabitEthernet0/0/1] port link-type trunk [PE1-GigabitEthernet0/0/1] port trunk allow-pass vlan 20 [PE1-GigabitEthernet0/0/1] quit
The configurations of PE2 and P are similar to the configuration of PE1, and are not mentioned here.
Configuration Files
- Configuration file of CE1
# sysname CE1 # bridge 1 # interface GigabitEthernet0/0/0 # interface GigabitEthernet0/0/0.1 bridge 1 bridge vlan-transmit enable vlan allow-pass vid 50 to 51 vlan dot1q-tunnel 20 # interface GigabitEthernet0/0/1 # interface GigabitEthernet0/0/1.1 bridge 1 bridge vlan-transmit enable vlan allow-pass vid 50 # interface GigabitEthernet0/0/2 # interface GigabitEthernet0/0/2.1 bridge 1 bridge vlan-transmit enable vlan allow-pass vid 51 # return
- Configuration file of CE2
# sysname CE2 # bridge 1 # interface GigabitEthernet0/0/0 # interface GigabitEthernet0/0/0.1 bridge 1 bridge vlan-transmit enable vlan allow-pass vid 50 to 51 vlan dot1q-tunnel 20 # interface GigabitEthernet0/0/1 # interface GigabitEthernet0/0/1.1 bridge 1 bridge vlan-transmit enable vlan allow-pass vid 50 vlan mapping 8021p 0 map-8021p 7 # interface GigabitEthernet0/0/2 # interface GigabitEthernet0/0/2.1 bridge 1 bridge vlan-transmit enable vlan allow-pass vid 51 # return
- Configuration file of PE1
# sysname PE1 # vlan batch 20 # interface GigabitEthernet0/0/0 port link-type trunk port trunk allow-pass vlan 20 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 20 # return
- Configuration file of PE2
# sysname PE2 # vlan batch 20 # interface GigabitEthernet0/0/0 port link-type trunk port trunk allow-pass vlan 20 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 20 # return
- Configuration file of P
# sysname P # vlan batch 20 # interface GigabitEthernet0/0/0 port link-type trunk port trunk allow-pass vlan 20 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 20 # return