Example for Configuring Priority Mapping
Networking Requirements
As shown in Figure 3-4, SwitchA and SwitchB are connected to the router, and enterprise branches 1 and 2 can access the network through LSW1 and LSW2. Enterprise branch 1 requires better QoS guarantee, so DSCP priorities of data packets from enterprise branches 1 and 2 are mapped to 45 and 30 respectively. The Switch trusts DSCP priorities of packets. When congestion occurs, the Switch first processes packets of higher DSCP priority.
Configuration Roadmap
- Create VLANs and configure interfaces so that the enterprise can access the network.
- Configure priority mapping to map DSCP priorities of data packets from enterprise branches 1 and 2 to 45 and 30 respectively.
Procedure
- Configure SwitchA.
# Create VLAN 100.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 100
# Set the link type of GE 0/0/1 and GE 0/0/2 to trunk and add them to VLAN 100.
[SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type trunk [SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] port link-type trunk [SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 100 [SwitchA-GigabitEthernet0/0/2] quit
# Configure interfaces to trust DSCP priorities of packets.
[SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] trust dscp [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] trust dscp [SwitchA-GigabitEthernet0/0/2] quit
# Configure priority mapping.
[SwitchA] qos map-table dscp-dscp [SwitchA-dscp-dscp] input 0 to 63 output 45 [SwitchA-dscp-dscp] quit
- Configure SwitchB.
# Create VLAN 200.
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] vlan batch 200
# Set the link type of GE 0/0/1 and GE 0/0/2 to trunk and add them to VLAN 200.
[SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] port link-type trunk [SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 200 [SwitchB-GigabitEthernet0/0/1] quit [SwitchB] interface gigabitethernet 0/0/2 [SwitchB-GigabitEthernet0/0/2] port link-type trunk [SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 200 [SwitchB-GigabitEthernet0/0/2] quit
# Configure interfaces to trust DSCP priorities of packets.
[SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] trust dscp [SwitchB-GigabitEthernet0/0/1] quit [SwitchB] interface gigabitethernet 0/0/2 [SwitchB-GigabitEthernet0/0/2] trust dscp [SwitchB-GigabitEthernet0/0/2] quit
# Configure priority mapping.
[SwitchB] qos map-table dscp-dscp [SwitchB-dscp-dscp] input 0 to 63 output 30 [SwitchB-dscp-dscp] quit
- Verify the configuration.
# View priority mapping information on SwitchA.
[SwitchA] display qos map-table dscp-dscp Input DSCP DSCP ------------------------ 0 45 1 45 2 45 3 45 4 45 ...... 63 45
# View the interface configuration on SwitchA.
[SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] display this # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 trust dscp # return [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] display this # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 100 trust dscp # return
# View priority mapping information on SwitchB.
[SwitchB] display qos map-table dscp-dscp Input DSCP DSCP ------------------------ 0 30 1 30 2 30 3 30 4 30 ...... 63 30
# View the interface configuration on SwitchB.
[SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] display this # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 200 trust dscp # return [SwitchB-GigabitEthernet0/0/1] quit [SwitchB] interface gigabitethernet 0/0/2 [SwitchB-GigabitEthernet0/0/2] display this # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 200 trust dscp # return
Configuration Files
- SwitchA configuration
file
# sysname SwitchA # vlan batch 100 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 trust dscp # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 100 trust dscp # qos map-table dscp-dscp input 0 to 44 output 45 input 46 to 63 output 45 # return
- SwitchB configuration
file
# sysname SwitchB # vlan batch 200 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 200 trust dscp # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 200 trust dscp # qos map-table dscp-dscp input 0 to 29 output 30 input 31 to 63 output 30 # return