if-match l2-protocol
Function
The if-match l2-protocol command configures a matching rule in a traffic classifier based on the Layer 2 protocol type.
The undo if-match l2-protocol command deletes a matching rule in a traffic classifier based on the Layer 2 protocol type.
By default, a matching rule based on the Layer 2 protocol type is not configured in a traffic classifier.
Parameters
Parameter |
Description |
Value |
---|---|---|
arp |
Classifies ARP packets. |
The value of arp corresponds to 0x0806. |
ip |
Classifies IP packets. |
The value of ip corresponds to 0x0800. |
rarp |
Classifies RARP packets. |
The value of rarp corresponds to 0x8035. |
protocol-value |
Specifies the value of a protocol type. |
The value ranges from 0x0600 to 0xFFFF in hexadecimal notation and must start with 0x. The value of protocol-value must be larger than 0x600. |
Usage Guidelines
Usage Scenario
You can run the if-match l2-protocol command to classify traffic based on the Layer 2 protocol type so that the device processes packets matching the same traffic classifier in the same manner.
Prerequisites
A traffic classifier has been created using the traffic classifier command in the system view.
Precautions
The device supports Layer 2 protocols including ARP, IP, and RARP.
If you run the if-match l2-protocol command in the same traffic classifier view multiple times, only the latest configuration takes effect.