Port Mirroring Commands

Use these commands to configure port mirroring.

Port mirroring, which is also known as port monitoring, selects network traffic that you can analyze with a network analyzer, such as a SwitchProbe device or other Remote Monitoring (RMON) probe.

monitor session source

M4250

M4350

This command adds a source interface for a port mirroring session that is identified by the session-id argument (an integer value).

Use the source interface {unit/slot/port | cpu | lag lag-group-id} parameters to specify the interface to monitor. You can also configure a VLAN as the source for the session (all member ports of that VLAN are monitored).

To specify an actual interface or port, do the following:

  • For an M4250 series switch, use the argument slot/port.
  • For an M4350 series switch, use the argument unit/slot/port, as shown in the command description and format.
Note: If an interface is a member of both a VLAN and a LAG, you cannot assign the VLAN as a source VLAN for a monitor session. However, if an interface is a member of a VLAN and you assign the VLAN as a source VLAN for a monitor session, afterwards you can add the interface as a member to a LAG.

You can configure remote port mirroring by specifying the remote vlan keywords and an RSPAN VLAN ID. At the source switch, you must specify the destination as the RSPAN VLAN. At the destination switch, you must specify the source as the RSPAN VLAN. You cannot configure the source and destination as remote on the same switch.

Note: On an intermediate switch, you must create an RSPAN VLAN, make sure that the ports that are connected to the source and destination switches are members of the RSPAN VLAN, and enable RSPAN VLAN egress tagging on the port that is connected to the destination switch.

Use rx to monitor only ingress packets or use tx to monitor only egress packets. If you do not specify an rx or tx option, the destination port monitors both ingress and egress packets.

Format monitor session session-id source {interface {unit/slot/port | cpu | lag lag-group-id} | vlan vlan-id | remote vlan vlan-id} [rx | tx]
Mode Global Config

no monitor session source

This command removes a source interface for a port mirroring session that is identified by the session-id argument (an integer value).

Format no monitor session session-id source {interface {unit/slot/port | cpu | lag lag-group-id} | vlan vlan-id | remote vlan vlan-id}
Mode Global Config

monitor session destination

M4250

M4350

This command adds a destination interface for a port mirroring session that is identified by the session-id argument (an integer value).

Use the destination interface parameter with the appropriate argument to specify the interface to monitor. To specify an actual interface or port, do the following:

  • For an M4250 series switch, use the argument slot/port.
  • For an M4350 series switch, use the argument unit/slot/port, as shown in the command format.

You can configure remote port mirroring by specifying the remote vlan keywords and an RSPAN VLAN ID. At the source switch, you must specify the destination as the RSPAN VLAN. At the destination switch, you must specify the source as the RSPAN VLAN. You cannot configure the source and destination as remote on the same switch.

Note: If an interface is a member of both a VLAN and a LAG, you cannot assign the VLAN as a destination VLAN for a monitor session. However, if an interface is a member of a VLAN and you assign the VLAN as a destination VLAN for a monitor session, afterwards you can add the interface as a member to a LAG.
Note: On an intermediate switch, you must create an RSPAN VLAN, make sure that the ports that are connected to the source and destination switches are members of the RSPAN VLAN, and enable RSPAN VLAN egress tagging on the port that is connected to the destination switch.

If you specify an RSPAN VLAN ID, you must also specify the reflector port at the source switch. The reflector port, which must be a member of the RSPAN VLAN, forwards the mirrored traffic to the destination switch. You specify the reflector port by entering the reflector-port keyword and the appropriate argument.

Format monitor session session-id destination {interface {unit/slot/port | lag lag-group-id} | remote vlan vlan-id reflector-port {unit/slot/port | lag lag-group-id}}
Mode Global Config

no monitor session destination

This command removes a destination interface for a port mirroring session that is identified by the session-id argument (an integer value).

Format no monitor session session-id destination {interface | remote vlan}
Mode Global Config

monitor session filter

M4250

M4350

This command attaches an IP ACL or MAC ACL to a selected monitor session by entering the access list number and name.

This command configures a probe port and a monitored port for a monitor session (port monitoring). Attaching a filter is not supported for an ERSPAN mirror session.

Format monitor session session-id filter {ip access-group {acl-id | ip-acl-name} | mac access-group mac-acl-name}
Mode Global Config
Parameter Description
session-id The monitor session (port monitoring), which can be from 1 to 4.
acl-id The IP ACL number.
ip-acl-name The IP ACL name.
mac-acl-name The MAC ACL name.

no monitor session filter

This command removes the specified IP ACL or MAC ACL from the selected monitoring session.

Format no monitor session session-id filter {ip access-group | mac access-group}
Mode Global Config

monitor session mode

M4250

M4350

This command enables a specified port mirroring session.

Format monitor session session-id mode
Mode Global Config

no monitor session mode

This command disables the specified port mirroring session.

Format no monitor session session-id mode
Mode Global Config

no monitor

M4250

M4350

This command removes all the source ports and destination port and restores the default value for the mirroring session mode for all the configured sessions.

With the optional session keyword and session-id argument, this command removes the specified monitor session (port monitoring) designation from the source probe port, the destination monitored port, and all VLANs. When the port is removed from the VLAN, you must manually add the port to any desired VLANs.

Note: This is a stand-alone no command. This command does not have a normal form.
Format no monitor [session session-id]
Mode Global Config

show monitor session

M4250

M4350

This command displays the port monitoring information for a specific or all mirroring sessions.

The session-id parameter is an integer value used to identify the session. In the current version of the software, the session-id parameter is a number from 1 to 4.

Format show monitor session {session-id | all}
Mode Privileged EXEC
Term Definition
Session ID An integer value used to identify the session. Its value can be anything between 1 and the maximum number of mirroring sessions allowed on the platform.
Monitor Session Mode Indicates whether the Port Mirroring feature is enabled or disabled for the session identified with session-id. The possible values are Enabled and Disabled.
Probe Port Probe port (destination port) for the session identified with session-id. If probe port is not set then this field is blank.
Source Port The port, which is configured as mirrored port (source port) for the session identified with session-id. If no source port is configured for the session then this field is blank.
Type Direction in which source port configured for port mirroring. Types are tx for transmitted packets and rx for receiving packets.
Src VLAN All member ports of this VLAN are mirrored. If the source VLAN is not configured, this field is blank.
Ref. Port This port carries all the mirrored traffic at the source switch.
Src Remote VLAN The source VLAN is configured at the destination switch. If the remote VLAN is not configured, this field is blank.
Dst Remote VLAN The destination VLAN is configured at the source switch. If the remote VLAN is not configured, this field is blank.
IP ACL The IP access-list id or name attached to the port mirroring session.
MAC ACL The MAC access-list name attached to the port mirroring session.

show vlan remote-span

M4250

M4350

This command displays the configured RSPAN VLAN.

Format show vlan remote-span
Mode Privileged EXEC Mode

Command example:

CODE
(NETGEAR Switch)# show vlan remote-span

Remote SPAN VLAN
------------------------------------------------------------------------
100