Configure Port Mirroring

Port mirroring sends copies of packets that enter or exit one port to another physical port or LAG interface, where the packets can be analyzed.

All protocols such as LLDP must be disabled on interfaces that you select to be destination interfaces.
  1. Access global configuration mode.
    device# configure terminal
  2. (If necessary) Disable protocols on the destination interface.
    This example disables LLDP.
    1. Enter interface configuration mode.
      device(config)# interface ethernet 0/2
    2. Disable LLDP.
      device(conf-if-eth-0/2)# lldp disable
      
    3. Exit interface configuration mode.
      device(conf-if-eth-0/2)# exit
  3. Enable the port mirroring session and assign a number.
    device(config)# monitor session 22
    
  4. Identify the source Ethernet interface port, the destination interface and port (either ethernet or port-channel) and the direction of the traffic to monitor.
    device(config-session-22)# source ethernet 0/1 destination ethernet 0/2 direction tx
    This example enables session 22 for monitoring traffic from source Ethernet 0/1 to destination Ethernet 0/2 in the egress direction.

Example

The following example summarizes the commands in this procedure.

device# configure terminal
device(config)# interface ethernet 0/2
device(conf-if-eth-0/2)# lldp disable
device(conf-if-eth-0/2)# exit
device(config)# monitor session 22
device(config-session-22)# source ethernet 0/1 destination ethernet 0/2 direction tx