The if-match destination-mac command configures a matching rule based on the destination MAC address in a traffic classifier.
The undo if-match destination-mac command deletes a matching rule based on the destination MAC address in a traffic classifier.
By default, a matching rule based on the destination MAC address is not configured in a traffic classifier.
Parameter |
Description |
Value |
---|---|---|
mac-address |
Specifies the destination MAC address. |
The value is in H-H-H format. An H is a hexadecimal number of 1 to 4 digits. |
mac-address-mask |
Specifies the mask of the destination MAC address. Similar to the mask of the IP address, the value F indicates that the destination MAC address is matched and the value 0 indicates that the destination MAC address is not matched. The mask of the MAC address determines a group of MAC addresses. The device can accurately match certain bits in the destination MAC address using the mask of the MAC address. In practice, you can set these bits to F in the mask of the destination MAC address. |
The value is in H-H-H format. An H is a hexadecimal number of 1 to 4 digits. The value cannot be 0-0-0. |
Usage Scenario
You can run the if-match destination-mac command to configure a matching rule based on the destination MAC address in a traffic classifier 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
If you run the if-match destination-mac command in the same traffic classifier view multiple times, only the latest configuration takes effect.
# Configure a matching rule based on the destination MAC address of 0050-ba27-bed3 in the traffic classifier c1.
<HUAWEI> system-view [HUAWEI] traffic classifier c1 operator and [HUAWEI-classifier-c1] if-match destination-mac 0050-ba27-bed3
# Configure a matching rule based on the destination MAC address of XX50-bXX7-bed3 in the traffic classifier c1.
<HUAWEI> system-view [HUAWEI] traffic classifier c1 operator and [HUAWEI-classifier-c1] if-match destination-mac 0050-b007-bed3 00ff-f00f-ffff