if-match source-mac
Function
The if-match source-mac command configures a matching rule in a traffic classifier based on the source MAC address.
The undo if-match source-mac command deletes a matching rule in a traffic classifier based on the source MAC address.
By default, a matching rule based on the source MAC address is not configured in a traffic classifier.
Format
if-match source-mac mac-address [ mac-address-mask mac-address-mask ]
undo if-match source-mac
Parameters
Parameter |
Description |
Value |
---|---|---|
mac-address |
Specifies the source MAC address. |
The value is in H-H-H format. An H is a hexadecimal number of 4 digits. |
mac-address-mask mac-address-mask |
Specifies the mask of the source MAC address. Similar to the mask of the IP address, the mask of the MAC address determines a group of MAC addresses. By using the mask of the MAC address, you can accurately match certain bits in the source MAC address. In practice, you can set these bits to F in the mask of the source MAC address. |
The value is in H-H-H format. An H is a hexadecimal number of 4 digits. The value cannot be 0-0-0. |
Usage Guidelines
Usage Scenario
You can run the if-match source-mac command to classify traffic based on the source MAC address 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 source-mac command in the same traffic classifier view multiple times, only the latest configuration takes effect.
Example
# Define a matching rule for the traffic classifier c1: Packets with source MAC address 0050-ba27-bed2 are matched.
<AC6605> system-view [AC6605] traffic classifier c1 operator and [AC6605-classifier-c1] if-match source-mac 0050-ba27-bed2
# Define a matching rule for the traffic classifier c1: Packets with source MAC address XX50-bXX7-bed3 are matched.
<AC6605> system-view [AC6605] traffic classifier c1 operator and [AC6605-classifier-c1] if-match source-mac 0050-ba27-bed3 mac-address-mask 00ff-f00f-ffff