Example for Configuring MQC
Procedure
- Configure a traffic classifier.
# Create traffic classifier c1 to match packets tagged with VLAN 2.
<HUAWEI> system-view [HUAWEI] traffic classifier c1 [HUAWEI-classifier-c1] if-match vlan-id 2 [HUAWEI-classifier-c1] quit
- Configure a traffic behavior.
# Create traffic behavior b1 and set the action to deny so that packets matching the specified rule are discarded.
[HUAWEI] traffic behavior b1 [HUAWEI-behavior-b1] deny [HUAWEI-behavior-b1] quit
- Configure a traffic policy.
# Create traffic policy p1, and associate traffic classifier c1 with traffic behavior b1 in the traffic policy.
[HUAWEI] traffic policy p1 [HUAWEI-trafficpolicy-p1] classifier c1 behavior b1 [HUAWEI-trafficpolicy-p1] quit
- Apply the traffic policy.
# Apply traffic policy p1 to the inbound direction of GE0/0/1.
[HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] traffic-policy p1 inbound [HUAWEI-GigabitEthernet0/0/1] quit [HUAWEI] quit
- Verify the configuration.
# Check the configuration of traffic classifier c1.
<HUAWEI> display traffic classifier user-defined c1 User Defined Classifier Information: Classifier: c1 Operator: OR Rule(s) : if-match vlan-id 2
# Check the configuration of traffic behavior b1.
<HUAWEI> display traffic behavior user-defined b1 User Defined Behavior Information: Behavior: b1 Deny
# Check the configuration of traffic policy p1.
<HUAWEI> display traffic policy user-defined p1 User Defined Traffic Policy Information: Policy: p1 Classifier: c1 Operator: OR Behavior: b1 Deny
# Display the record of the applied traffic policy p1.
<HUAWEI> display traffic-policy applied-record p1 ------------------------------------------------- Policy Name: p1 Policy Index: 0 Classifier:c1 Behavior:b1 ------------------------------------------------- *interface GigabitEthernet0/0/1 traffic-policy p1 inbound slot 0 : success (support sharing) ------------------------------------------------- Policy total applied times: 1.
Related Information
Example for Configuring MQC to Implement Traffic Policing
Example for Configuring Hierarchical Traffic Policing
Example for Configuring Rate Limiting in a Specified Time Range
Example for Configuring Rate Limiting for Users on Different Network Segments
Example for Configuring Packet Filtering