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

Syntax


vlan vid-# monitor all [in | out | both] [mirror 1 - 4 | name-str] [{1 - 4 | name-str} | {1 - 4 | name-str} | {1 - 4 | name-str}]

This command assigns a monitored VLAN source to a previously configured mirroring session on a source switch by specifying the VLAN ID, the direction of traffic to mirror, and the session.

vlan vid-#

Identifies the VLAN on which to mirror traffic.

monitor all [in | out | both]

Uses the direction of traffic on the specified vid-# to select traffic to mirror. If you enter the monitor all command without selection criteria or a session identifier, the command applies by default to session 1.

mirror [1 - 4 | name-str]

Assigns the VLAN traffic defined by the VLAN ID and traffic direction to a session number or name.

Depending on how many sessions are already configured on the switch, you can use the same command to assign the specified VLAN source to up to four sessions, for example, interface a1 monitor all in mirror 1 2 4.
  • 1 - 4: Configures the selected VLAN traffic to be mirrored in the specified session number.
  • [name name-str]: Optional; configures the selected 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. To configure an alphanumeric name for a mirroring session, see the command description under Configuring a source switch in a remote mirroring session.

Assigning a VLAN to a mirroring session precludes assigning any other mirroring sources to the same session. If a VLAN is already assigned to a given mirroring session, using this command to assign another VLAN to the same mirroring session results in the second assignment replacing the first. Also, if there are other (port, trunk, or mesh) mirroring sources already assigned to a session, the switch displays a message similar to:

Mirror source port exists on session N. Can not add mirror
source VLAN.

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