How do I configure a Port Mirror in cnMatrix

Summary: This article describes how to setup a Port Mirror in cnMatrix via the CLI and WebGUI. A port mirror can be used to capture packets over the wire for troubleshooting purposes.

CLI

  1. Log in to the Switch via SSH using an application such as PuTTy

  2. Enter into privilege exec mode by typing the below

    configure terminal

  3. Decide on what source port you wish to mirror and the destination port that you wish to mirror the packets to. For the destination, this would typically be a machine with Wireshark or another packet capturing application. As a helpful tip, you can use the command show mac-address-table to find what source port the device you wish to mirror is connected to.

  4. Type the following commands to configure the source interface, changing the arbitrary session number and interface to suit. The session number needs to be the same for the source and the destination.

    monitor session <1-7> source interface <interface/ip-acl/mac-acl/vlan> <both/rx/tx>

    For example

    source

  5. Type the following commands to configure the destination interface, changing the arbitrary session number and interface to suit. The session number needs to be the same for the source and the destination.

    monitor session <1-7> destination interface <interface/ip-acl/mac-acl/vlan>

    For example

    dest

  6. Plug in the capturing device such as a laptop running Wireshark into your destination interface to start capturing.

  7. To remove the Port Mirror after you have finished, use the below command, replacing the session number with the session value you used.

    no monitor session <1-7>

    remove

WebGUI

  1. Log in to the Switch WebGUI

  2. Expand the Layer 2 Management menu option on the left and click Mirroring

  3. In the Mirroring Control Settings, first enter your Session Index, this is an arbitrary value between 1 and 7.

  4. Select the Mirror Type drop-down and select between Port, MAC ACL, VLAN and IP ACL. In this example, we are setting a Port Mirror type.

  5. Enter the Source Entity (Interface number) and Destination Entity (Interface number). The Source entity is the port you wish to mirror and the Destination entity is the port you wish to capture the mirrored packets on.

  6. Select the Mirror Mode option you wish to use between Both/Ingress only/Exgress only.

  7. Click Add to complete the Port Mirror setup. At this point, you can plug in the capturing device such as a laptop running Wireshark into your destination interface to start capturing.

  8. To remove the Port Mirror when you have finished, select the radio button next to the Port Mirror and click Delete.