Configuring classifier-based mirroring
For more information and a list of general steps for the process beginning with this command, see the information about restrictions on classifier-based mirroring.
Context: Global configuration
Syntax
[ no ]
class
[ipv4
|ipv6
classname
]Defines the name of a traffic class and specifies whether a policy is to be applied to IPv4 or IPv6 packets, where
classname
is a text string (64 characters maximum.)After you enter the
class
command, you enter the class configuration context to specify match criteria. A traffic class contains a series ofmatch
andignore
commands, which specify the criteria used to classify packets.To configure a default traffic class, use the
default-class
command as described below. A default class manages the packets that do not match the match/ignore criteria in any other classes in a policy.
Context: Class configuration
Syntax
[ no ]
[
[seq-number
]match
|ignore
ip-protocol
source-address
destination-address
] [ip-dscp
codepoint
] [precedence
precedence-value
] [tos
tos-value
] [vlan
vlan-id
]For detailed information about how to enter
match
andignore
commands to configure a traffic class, the Advanced Traffic Management Guide.
Context: Global configuration
Syntax
[ no ]
policy mirror
policy-name
Defines the name of a mirroring policy and enters the policy configuration context.
A traffic policy consists of one or more classes and one or more mirroring actions configured for each class of traffic. The configured actions are executed on packets that match a
match
statement in a class. No policy action is performed on packets that match anignore
statement.
Context: Policy configuration
Syntax
Defines the mirroring action to be applied on a pre-configured IPv4 or IPv6 traffic class when a packet matches the
match
criteria in the traffic class. You can enter multipleclass action mirror
statements in a policy.
[
seq-number
]The (optional)
seq-number
parameter sequentially orders the mirroring actions that you enter in a policy configuration. Actions are executed on matching packets in numerical order.Default: Mirroring action statements are numbered in increments of 10, starting at 10.
class
[ipv4
|ipv6
classname
]Defines the preconfigured traffic class on which the mirroring actions in the policy are executed and specifies whether the mirroring policy is applied to IPv4 or IPv6 traffic in the class. The classname is a text string (64 characters maximum.)
action mirror
session
Configures mirroring for the destination and session specified by the
session
parameter.
Context: Policy configuration
Syntax
[ no ]
default-class action mirror
[session
action mirror
session
...]Configures a default class that allows packets that are not matched nor ignored by any of the class configurations in a mirroring policy to be mirrored to the destination configured for the specified session.
Applying a mirroring policy on a port or VLAN interface
Enter one of the following service-policy
commands
from the global configuration context.
Context: Global configuration
Syntax
interface
<PORT-LIST>
service-policypolicy-name
inConfigures the specified ports with a mirroring policy that is applied to inbound traffic on each interface.
Separate individual port numbers in a series with a comma, for example,
a1,b4,d3
. Enter a range of ports by using a dash, for example,a1-a5
.The mirroring policy name you enter must be the same as the policy name you configured with the
policy mirror
command.
Syntax
vlan
vlan-id
service-policypolicy-name
inConfigures a mirroring policy on the specified VLAN that is applied to inbound traffic on the VLAN interface.
Valid VLAN ID numbers range from 1 to 4094.
The mirroring policy name you enter must be the same as the policy name you configured with the
policy mirror
command in the syntax ???.