< Home

if-match discard

Function

The if-match discard command configures a matching rule based on drop packets in a traffic classifier.

The undo if-match discard command deletes a matching rule based on drop packets in a traffic classifier.

By default, no matching rule based on drop packets is configured in a traffic classifier.

Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support this command.

Format

if-match discard

undo if-match discard

Parameters

None

Views

Traffic classifier view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

After packets reach the device, invalid packets are discarded. You can run the if-match discard command to configure the device to match discarded packets, take action for the discarded packets such as traffic statistics collection and mirroring, and analyze them.

Prerequisites

A traffic classifier has been created using the traffic classifier command in the system view.

For the S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-HI, S6730-H, S6730S-H, S6730-S, and S6730S-S, both the traffic classifier defining if-match discard and traffic classifiers defining other matching rules (excluding if-match application) take effect. Examples are as follows:
  • A packet matches two pairs of traffic classifiers and traffic behaviors defined in the same traffic policy, and only one traffic classifier contains if-match discard. (The other traffic classifier does not contain if-match discard or if-match application.) In this case, both pairs of traffic classifiers and traffic behaviors take effect for the packet.
  • A packet matches two traffic policies, and a traffic classifier contains if-match discard in only one of the traffic policies. (The other traffic policy does not contain if-match discard or if-match application.) In this case, both traffic policies take effect for the packet.

Example

# Configure a matching rule based on discarded packets in the traffic classifier c1.

<HUAWEI> system-view
[HUAWEI] traffic classifier c1
[HUAWEI-classifier-c1] if-match discard
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >