This section describes how to use a traffic classifier to define the traffic to be mirrored, specify flow mirroring for a traffic behavior, define a traffic policy that associates the traffic classifier with the traffic behavior, and apply the traffic policy globally.
Context
When more precise analysis of user traffic is required, you can configure a mirroring traffic policy and apply it globally. In this way, only the packets that meet specified filtering conditions are copied to the observing port for analysis.
Procedure
- Configure an ACL.
- Run system-view
The system view is displayed.
- Run acl name ucl-acl-name ucl [ match-order { auto | config } ]
A named ACL is created, and the corresponding ACL view is displayed.
- Run rule [ rule-id ] [ name rule-name ] { deny | permit } ip [ destination { destination-ip-address { destination-wildcard | 0 } | any } | source { source-ip-address { source-wildcard | 0 } | any } ] *
An advanced ACL is created in the advanced ACL view.
- Run return
Return to the user view.
- Define a traffic classifier.
- Run system-view
The system view is displayed.
- Run traffic classifier classifier-name [ operator { and | or } ]
A traffic classifier is defined, and the traffic classifier view is displayed.
The classifier name specified by the classifier-name parameter cannot be predefined by the system. For configuration details, see HUAWEI NetEngine 8000 F Series Router Configuration Guide > QoS.
- Run if-match [ ipv6 ] acl { acl-number | name acl-name }
An ACL-based filtering rule is defined.
- Run commit
The configuration is committed.
- Run return
Return to the user view.
- Define a traffic behavior and enable flow mirroring.
- Run system-view
The system view is displayed.
- Run traffic behavior behavior-name
A traffic behavior is defined and the traffic behavior view is displayed.
- Run port-mirroring enable
Local flow mirroring is enabled.
- (Optional) Run port-mirroring car cir cir-value [ pir pir-value ] [ cbs cbs-value [ pbs pbs-value ] ]
The CAR function is enabled for mirrored traffic.
- Run commit
The configuration is committed.
- Run return
Return to the user view.
- Define a traffic policy that associates a traffic classifier with a traffic behavior.
- Run system-view
The system view is displayed.
- Run traffic policy policy-name
A traffic policy is defined, and the traffic policy view is displayed.
- Run classifier classifier-name behavior behavior-name
A traffic behavior is specified for a traffic classifier in the traffic policy.
- Run commit
The configuration is committed.
- Run return
Return to the user view.
- Create a mirroring service policy and bind it to a service group.
- Run system-view
The system view is displayed.
- Run service-policy name policy-name mirror
A mirroring traffic policy is created and the service policy view is displayed.
- Run service-group service-group-name [ inbound | outbound ] [ priority priority ]
A service group is bound to the service policy.
- Run commit
The configuration is committed.
- Run return
Return to the user view.
- Configure the mapping between the Option 82 attribute and a service policy.
- Run system-view
The system view is displayed.
- Run mirror rule [ rule-number ] service-policy service-policy service-policy service-policy [ partial-match ] { circuit-id | remote-id } description-text
The mapping between a traffic policy and the Option 82 attribute is configured.
- Run commit
The configuration is committed.
- Apply the traffic policy globally.
- Run traffic-policy policy-name { inbound | outbound }
The traffic policy is applied globally to filter BAS-side user packets.
In VS mode, this command is supported only by the admin VS.
- Run commit
The configuration is committed.