Port mirror commands

Use these M4500 CLI commands to configure port mirroring sessions with source and destination ports, RSPAN VLANs, and ACL filters, and display sessions.

This section describes the commands you use to select network traffic that you can analyze with a network analyzer.

Note: On LY4R, one port cannot join more than one port-monitor session regardless of source port or destination port due to the HW limitation.

show port-mirror session

Use this command to display the port monitoring information for the specified session.

Format show port-monitor session { <1-4> | all }
Mode Privileged EXEC
Parameter Definition
<1-4> An integer value used to identify the session.Its value can be anything between 1 and the maximum number of mirroring sessions(4) allowed on the platform.
all Displays the all sessions

Display Message

Fields Definition
Session ID The session ID. The range of session ID is 1 to 4.
Admin Mode Indicates whether the Port Monitoring feature is enabled or disabled. 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.
Src VLAN All member ports of this VLAN are mirrored. If the source VLAN is not configured, this field is blank.
Mirrored Port The port that is configured as a mirrored port (source port) for the session identified with session-id. If no source port is configured for the session, this field is blank.
Ref. Port This port carries all the mirrored traffic at the source switch.
Src RVLAN The source VLAN is configured at the destination switch. If the remote VLAN is not configured, this field is blank.
Dst RVLAN The destination VLAN is configured at the source switch. If the remote VLAN is not configured, 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.
IP ACL The IP access-list id or name attached to the port mirroring session.
MAC ACL The MAC access-list id or name attached to the port mirroring session.

port-monitor session source

This command configures the source interface for a selected monitor session. Use the source interface slot/port parameter to specify the interface to monitor. Use rx to monitor only ingress packets, or use tx to monitor only egress packets. If you do not specify an {rx | tx} option, the destination port monitors both ingress and egress packets.

A VLAN can be configured as the source to a session (all member ports of that VLAN are monitored). Remote port mirroring is configured by adding the RSPAN VLAN ID. At the source switch, the destination is configured as the RSPAN VLAN and at the destination switch, the source is configured as the RSPAN VLAN.

Note: The source and destination cannot be configured as remote on the same device. On LY4R, one port cannot join more than one port-monitor session regardless of source port or destination port due to the HW limitation.
Format port-monitor session <1-4> source {interface {<port-list> | <slot/port> | cpu | port-channel {<1-64> | <chId-list>}} [{rx | tx}] | remote vlan <1-4093>| vlan <1-4093>}

no port-monitor [session <1-4> [source {interface {<port-list> | <slot/port> | cpu | port-channel {<1-64> | <chId-list>}} | remote vlan | vlan}]]

Parameter Definition
<1-4> The session ID, which can be 1, 2, 3, or 4.
<port-list> The physical-port IDs in range from 1 to 48. Use '-' to specify a range, or ',' to separate physical port IDs in a list. Spaces and zeros are not permitted.
<slot/port> The interface number.
port-channel <1-64> The port-channel interface number. The range of the port-channel ID is from 1 to 64.
port-channel <chId-list> The channel IDs in range <1-64>. Use '-' to specify a range, or ',' to separate physical-port IDs in a list. Spaces and zeros are not permitted.
rx | tx Option rx is used to monitor only ingress packets. Option tx is used to monitor only egress packets. If no option is specified, both ingress and egress packets, RX and TX, are monitored.
remote vlan <1-4093> The VLAN ID to be monitored on the remote switch. The range is 1 to 4093.
vlan <1-4093> The VLAN ID to be monitored. The range is 1 to 4093.
Default None
Mode Global Config

no port-monitor session source

Use this command to remove the specified mirrored port from the selected port mirroring session.

Default None
Format no port-monitor session <session-id> source { interface {<slot/port> | cpu | port-channel } [ {rx | tx} } | remote vlan <vlan-id>| vlan <vlan-id> }
Mode Global Config

port-monitor session destination

This command configures the probe interface for a selected monitor session. This command configures a probe port and a monitored port for monitor session (port monitoring).

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

A VLAN can be configured as the source to a session (all member ports of that VLAN are monitored). Remote port mirroring is configured by adding the RSPAN VLAN ID. At the source switch, the destination is configured as the RSPAN VLAN and at the destination switch, the source is configured as the RSPAN VLAN.

Note: The source and destination cannot be configured as remote on the same device. On LY4R, one port cannot join more than one port-monitor session regardless of source port or destination port due to the HW limitation.

The reflector-port is configured at the source switch along with the destination RSPAN VLAN. The reflector port forwards the mirrored traffic towards the destination switch.

Note: This port must be configured with RSPAN VLAN membership.
Default None
Format port-monitor session <1-4> destination { interface <slot/port> | remote vlan <1-4093> reflector-port <slot/port> }
Mode Global Config
Parameter Definition
<1-4> Session number. The range of session id is 1 to 4
interface <slot/port> The Interface number .
remote vlan <1-4093> The VLAN ID to be monitored on the remote switch. The range is 1 to 4093.
reflector-port <slot/port> The Interface number for reflector-port.

no port-monitor session destination

Use this command to remove the specified probe port from the selected port mirroring session.

Default None
Format no port-monitor session <session-id> destination { interface <slot/port> | remote vlan <vlan-id> reflector-port <slot/port> }
Mode Global Config

port-monitor session filter

This command attaches an IP/MAC ACL to a selected monitor session. This command configures a probe port and a monitored port for monitor session (port monitoring).

An IP/MAC ACL can be attached to a session by giving the access list number/name.

Use the filter parameter to filter a specified access group either by IP address or MAC address.

Note: IP/MAC ACL can be attached to a session by giving the access list number/name. On the platforms that do not support both IP and MAC ACLs to be assigned on the same Monitor session, an error message is thrown when user tries to configure ACLs of both types.
Default None
Format port-monitor session <1-4> filter { ip | mac } access-group <aclid | ip-acl-name>
Mode Global Config
Parameter Definition
<1-4> Session number. The range of session id is 1 to 4
ip | mac Indicates IP or MAC ACLs will be attached to the session.
<aclid> Enter an integer specifying an IP ACL number.
<ip-acl-name> Enter access-list name up to 31 characters in length .

no port-monitor session filter

Use this command to remove the specified IP/MAC ACL from the selected monitoring session.

Default None
Format no port-monitor session <session-id> filter { ip | mac } access-group
Mode Global Config

port-monitor session mode

Use this command to configure the mode parameters to enable the administrative mode of the selected port mirroring session. If enabled, the probe port monitors all the traffic received and transmitted on the physical monitored port.

Default None
Format port-monitor session <1-4> mode
Mode Global Config
Parameter Definition
<1-4> Session number. The range of session id is 1 to 4

no port-monitor session mode

The command disables port-monitoring function for the selected port monitoring session.

Default None
Format no port-monitor session <session-id> mode
Mode Global Config

no port-monitor session

Use this command without optional parameters to remove the monitor session (port monitoring) destination from the source probe port, the destination monitored port and all VLANs. Once the port is removed from the VLAN, you must manually add the port to any desired VLANs.

Default None
Format no port-monitor session <session-id>
Mode Global Config
Parameter Definition
<1-4> Session number. The range of session id is 1 to 4

no port-monitor

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

Default enabled
Format no port-monitor
Mode Global Config