< Home

if-match protocol

Function

The if-match protocol command configures a matching rule based on a protocol in a traffic classifier.

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

By default, a matching rule based on a protocol is not configured in a traffic classifier.

Format

if-match protocol { ip | ipv6 }

undo if-match protocol

Parameters

Parameter

Description

Value

ip

Specifies an IP protocol.

-

ipv6

Specifies an IPv6 protocol.

-

Views

Traffic classifier view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

You can run the if-match protocol command to classify packets based on a protocol so that the device processes packets of the same protocol in the same manner.

Prerequisites

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

Precautions

Currently, the device supports IPv4 and IPv6.

If you run the if-match protocol command in the same traffic classifier view multiple times, only the latest configuration takes effect.

If the relationship between rules in a traffic classifier is AND, and both the if-match protocol and if-match l2-protocol arp commands are configured in this traffic classifier, of the two, only the if-match l2-protocol arp command takes effect.

Example

# Configure a matching rule based on the IP protocol in the traffic classifier c1.

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