The if-match l2-protocol command configures a matching rule based on the Layer 2 protocol type in a traffic classifier.
The undo if-match l2-protocol command deletes a matching rule based on the Layer 2 protocol type in a traffic classifier.
By default, a matching rule based on the Layer 2 protocol type is not configured in a traffic classifier.
Parameter |
Description |
Value |
---|---|---|
arp |
Indicates that ARP packets are classified. |
The value of arp corresponds to 0x0806. |
ip |
Indicates that IP packets are classified. |
The value of ip corresponds to 0x0800. |
mpls |
Indicates that MPLS packets are classified. |
The value of mpls corresponds to 0x8847. |
rarp |
Indicates that RARP packets are classified. |
The value of rarp corresponds to 0x8035. |
protocol-value |
Specifies the value of a protocol type. |
The value ranges from 0x0000 to 0xFFFF in hexadecimal notation and must start with 0x. If the value of protocol-value is smaller than 0x0600, the Destination Service Access Point (DSAP) and Source Service Access Point (SSAP) fields in the Logical Line Control (LLC) protocol packets are matched. |
Usage Scenario
You can run the if-match l2-protocol command to classify packets 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, MPLS, 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.
If the relationship between rules in a traffic classifier is AND, and both the if-match l2-protocol arp and if-match protocol { ip | ipv6 } commands are configured in this traffic classifier, of the two, only the if-match l2-protocol arp command takes effect.