Mirroring Traffic Mirroring
Configuration Guide  
  727
Note:
• 
The member ports of an LAG cannot be set as a destination port or source port.
• 
A port cannot be set as the destination port and source port at the same time.
1.2  Using the CLI
Follow these steps to configure Mirroring.
Step 1 configure
Enter global configuration mode.
Step 2 monitor session 
session_num 
destination interface { fastEthernet 
port
 | gigabitEthernet 
port 
| ten-gigabitEthernet 
port
}
Enable the port mirror function and set the destination port.
session_num: 
The monitor session number. It can only be specified as 1.
port
: The destination port number. You can specify only one destination port for the mirror 
session.
Step 3 monitor session 
session_num 
source { cpu 
cpu_numbr
 | interface { fastEthernet 
port-list
 
| gigabitEthernet 
port-list 
| ten-gigabitEthernet 
port-list
 | port-channel 
port-channel-id 
}} 
mode
Configure ports or LAGs as the monitored interfaces. 
session_num
: The monitor session number. It can only be specified as 1. 
cpu_number: 
The CPU number. It can only be specified as 1. 
port-list:
 List of source ports. It is multi-optional.
mode
: The monitor mode. There are three options: rx, tx and both:
rx: The incoming packets of the source port will be copied to the destination port. 
tx: The outgoing packets of the source port will be copied to the destination port. 
both: Both of the incoming and outgoing packets on source port can be copied to the 
destination port.
Note: 
You can configure one or more source interface types (ports, LAGs and the CPU) according 
to your needs.
Step 4 show monitor session
Verify the Port Mirror configuration.
Step 5 end
Return to privileged EXEC mode.
Step 6 copy running-config startup-config
Save the settings in the configuration file.
The following example shows how to copy the received and transmitted packets on port 
1/0/1,2,3 and the CPU to port 1/0/10.
Switch#configure
Switch(config)#monitor session 1 destination interface gigabitEthernet 1/0/10