The capture of network traffic can be useful in troubleshooting issues. Although it is possible to complete this on the switch itself your milage may vary. You require a machine with some packet capture software running and listening on the relevant network interface.
In this example we’ll be mirroring port 1 to port 10, ergo, port 1 will have the device whose traffic we want to capture and port 10 will be where the traffic is being sent to. You should ensure that the destination port/interface does not have any configuration applied (e.g. VLANs etc) prior to the packet capture.
Create the mirror, add the destination port (10) and then add the source port.
create mirror MIRROR1
configure mirror MIRROR1 to PORT 10
configure mirror MIRROR1 add port 1
enable mirror MIRROR1
(i) By default all VLANs are included and both ingress and egress traffic is captured.
To disable a mirror:
disable mirror MIRROR1
To remove a mirror:
delete mirror MIRROR1
To show a mirror or show a mirror’s configuration:
show mirror "MIRROR1"
show configuration | include mirror
In this example we’ll be capturing interface (port) 1/1 i.e. the in-port to the out-port 1/25.
mirror-by-port <Instance ID> in-port <Switch Port Numbers> out-port <PC Connected Port Number> mode both enable
mirror-by-port 1 in-port 1/1 out-port 1/25 mode both enable
Disable a mirror:
no mirror-by-port <Instance ID> enable