Selecting all traffic on a port interface for mirroring according to traffic direction

Syntax


[no] interface port/trunk/mesh monitor [in | out | both] [mirror 1 | name-str] [{1 | name-str} | {1 | name-str} | {1 | name-str}] [no-tag-added]

Assigns a mirroring source to a previously configured mirroring session on a source switch by specifying the port, trunk, and/or mesh sources to use, the direction of traffic to mirror, and the session.

interface port/trunk/mesh

Identifies the source ports, static trunks, and/or mesh on which to mirror traffic.

Use a hyphen for a range of consecutive ports or trunks (a5-a8, Trk2-Trk4.)

Use a comma to separate non-contiguous interfaces (b11, b14, Trk4, Trk7.)


monitor all [in | out | both]
For the interface specified by port/trunk/mesh , selects traffic to mirror based on whether the traffic is entering or leaving the switch on the interface:
  • in: Mirrors entering traffic.
  • out: Mirrors exiting traffic.
  • both: Mirrors traffic entering and exiting.
If you enter the monitor all command without selection criteria or a session identifier, the command applies by default to session 1

mirror [1 | name-str]

Assigns the traffic specified by the interface and direction to a session by number or—if configured—by name. The session must have been previously configured.

Depending on how many sessions are already configured on the switch, you can use the same command to assign the specified source to up to four sessions, for example, interface a1 monitor all in mirror 1.
  • 1 : Configures the port traffic to be mirrored in the specified session number.
  • [ name name-str]: Optional; configures the port traffic to be mirrored in the specified session name. The string can be used interchangeably with the session number when using this command to assign a mirroring source to a session.
[no-tag-added]

Prevents a VLAN tag from being added to the mirrored copy of an outbound packet sent to a local or remote mirroring destination.

The no form of the command removes a mirroring source assigned to the session, but does not remove the session itself. This enables you to repurpose a session by removing an unwanted mirroring source and adding another in its place.