This part is an example for configuring and applying priority mapping rules.
As shown in Figure 1, DeviceA and DeviceB connect to each other through a VLAN. When IP packets sent by DeviceA enter the VLAN, by default, the precedence of these IP packets is mapped to the 802.1p value. When these IP packets (carrying VLAN frame priority) leave the VLAN and arrive at DeviceB, the VLAN frame priority is mapped to the IP precedence according to the configuration on DeviceB. Then, these packets are forwarded according to their IP precedence.
Interfaces 1 through 3 in this example are GE 0/1/0, GE 0/1/8.1, GE 0/1/16, respectively.
When configuring VLAN QoS, pay attention to the following:
The configuration roadmap is as follows:
Configure the VLAN and routes on DeviceA and DeviceB.
Configure QoS policies on DeviceB.
To complete the configuration, you need the following data:
Names of traffic classification, traffic behaviors, and traffic policies
Preferences for re-marking
<HUAWEI> system-view [~HUAWEI] sysname DeviceB [*HUAWEI] commit [~DeviceB] traffic classifier test [*DeviceB-classifier-test] if-match 8021p 2 [*DeviceB-classifier-test] commit [~DeviceB-classifier-test] quit
[~DeviceB] traffic behavior test [*DeviceB-behavior-test] remark ip-precedence 4 [*DeviceB-behavior-test] commit [~DeviceB-behavior-test] quit
[~DeviceB] traffic policy test [*DeviceB-trafficpolicy-test] classifier test behavior test [*DeviceB-trafficpolicy-test] commit [~DeviceB-trafficpolicy-test] quit
[~DeviceB] interface Gigabitethernet 0/1/8.1 [*DeviceB-Gigabitethernet0/1/8.1] traffic-policy test inbound link-layer [*DeviceB-Gigabitethernet0/1/8.1] commit [~DeviceB-Gigabitethernet0/1/8.1] quit
After the preceding configurations, when packets whose IP precedence is 2 are forwarded by GE0/1/0.1 on DeviceA reach the VLAN, the IP precedence 2 is mapped to the VLAN priority 2. After these VLAN frames reach DeviceB, DeviceB forwards these VLAN frames as IP packets with the IP precedence of 4 to the network segment 10.1.2.0/24.
Configuration file of DeviceB
#
sysname DeviceB
#
traffic classifier test operator or
if-match 8021p 2
#
traffic behavior test
remark ip-precedence 4
#
traffic policy test
classifier test behavior test precedence 1
#
interface GigabitEthernet0/1/8.1
traffic-policy test inbound link-layer
#
return