The observe user-defined-filter command configures a user-defined any byte matching rule for mirroring.
The undo observe user-defined-filter command cancels the configuration.
By default, there are no user-defined any byte matching rules for mirroring on the Device.
Parameter | Description | Value |
---|---|---|
id |
Specifies a rule ID. |
The value is an integer ranging from 1 to 8. |
offset offset-value |
Specifies a packet offset. |
The value is an integer ranging from 0 to 114. |
value value |
Specifies a packet matching value. |
The value is a hexadecimal integer ranging from 0 to 0xffffffff. |
value-mask |
Specifies a packet matching mask value. |
The value is a hexadecimal integer ranging from 0 to 0xffffffff. |
Usage Scenario
To mirror packets with specific characteristics, run the observe user-defined command to configure a user-defined any byte matching rule for mirroring. After that, packets matching the rule can be mirrored to the observing port.
When a user-defined offset rule is delivered, an AND operation is performed for the packet value and mask value, which are both 32 bits or automatically considered added to 32 bits if not. When a packet is matched against the rule, an AND operation is performed for the 32-bit packet content that is obtained based on the offset value and the configured mask value, and the operation result is matched against the delivered matching rule. If they match, the packet matches the rule and can be mirrored. If they do not match, the packet is dropped.Precautions
In VS mode, this command is supported only by the admin VS.
The value range of offset-value varies according to the board type. The maximum value supported is subject to the information returned by the device when it is applied to the mirrored port.<HUAWEI> system-view [~HUAWEI] observe user-defined-filter 1 offset 0 value abcdabcd ffffffff [*HUAWEI] interface GigabitEthernet0/1/1 [*HUAWEI-GigabitEthernet0/1/1] port-mirroring inbound user-defined-filter 1 [*HUAWEI-GigabitEthernet0/1/1] commit [~HUAWEI-GigabitEthernet0/1/1]