2.15. Mirror Commands

2.15.1. monitor session destination interface

Command Purpose

Use this command to set mirror destination interface.

To remove this setting, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

monitor session SESSION-ID destination interface IFNAME

no monitor session SESSION destination

Parameter

Parameter Description

Parameter Value

SESSION-ID

mirror session number

1 - 3

IFNAME

mirror destination interface

Support aggregation, physical and tunnel interfaces

Command Mode

Global Config

Default

None

Usage

Same session can’t configure both local destination interface and remote destination VLAN.(About the remote destination VLAN, please refer to chapter “monitor session destination remote”.)

Examples

This example shows how to set the mirror destination port to eth-0-1 in session 1:

Switch# configure terminal
Switch(config)# monitor session 1 destination interface eth-0-1

This example shows how to remove this setting:

Switch# configure terminal
Switch(config)# no monitor session 1 destination

2.15.2. monitor session destination cpu

Command Purpose

Use this command to set mirror destination of CPU.

To remove this setting, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

`monitor session SESSION-ID destination cpu``

no monitor session SESSION-ID destination

Parameter

Parameter Description

Parameter Value

SESSION-ID

mirror session number

1 - 3

destination cpu

mirror destination CPU

-

Command Mode

Global Config

Default

None

Usage

The destination can be cpu port.

Same session can’t configure both destination cpu and remote destination VLAN.(About the remote destination VLAN, please refer to chapter “monitor session destination remote”.)

Examples

This example shows how to set the mirror destination to CPU in session 1:

Switch# configure terminal
Switch(config)# monitor session 1 destination cpu

This example shows how to remove this setting:

Switch# configure terminal
Switch(config)# no monitor session 1 destination

Related Commands

monitor session SESSION-ID source interface

monitor session SESSION-ID source vlan

show monitor

2.15.3. monitor session destination group

Command Purpose

Use this command to create mirror multi destination group and enter mirror destination group mode.

To remove this setting, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

monitor session SESSION-ID destination group GROUP-ID

no monitor session SESSION-ID destination

Parameter

Parameter Description

Parameter Value

SESSION-ID

mirror session number

1 - 3

Destination group GROUP-ID

mirror destination group id number

1 - 32

Command Mode

Global Config

Default

None

Usage

Only one session can configure to multi-dest group. The session type only support local destination interface. One session can have multi destination group members which port is physical port. Same session can’t configure both local destination interface and remote destination VLAN.(About the remote destination VLAN, please refer to chapter “monitor session destination remote”.)

Examples

This example shows how to create the mirror to multi-destination group in session 1.:

Switch# configure terminal
Switch(config)# monitor session 1 destination group 1

This example shows how to remove this setting:

Switch# configure terminal
Switch(config)# no monitor session 1 destination

Related Commands

monitor session SESSION-ID source interface

member

show monitor

2.15.4. member

Command Purpose

Use this command to add a group member mirror destination interface for a mirror destination group.

To remove this setting, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

member IFPHYSICAL

Parameter

Parameter Description

Parameter Value

IFPHYSICAL

mirror destination interface

Support physical ports

Command Mode

Mirror Destination Group Configuration

Default

None

Usage

The destination interface only can be physical port. It can be neither VLAN interface nor Aggregator interface.

Same session can’t configure both local destination interface and multi-destination interface

Examples

This example shows how to add the mirror destination eth-0-1 to group of multi-destination session:

Switch# configure terminal
Switch(config)# monitor session 1 destination group 1
Switch(config-monitor-d-group)# member eth-0-1

This example shows how to remove this setting:

Switch# configure terminal
Switch(config)# monitor session 1 destination group 1
Switch(config-monitor-d-group)# no member eth-0-1

Related Commands

monitor session SESSION-ID source interface

monitor session SESSION-ID destination group GROUP-ID

show monitor

2.15.5. monitor session source interface

Command Purpose

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

monitor session SESSION-ID source interface interface (both|tx|rx )

no monitor session SESSION-ID source interface IFNAME (both|tx|rx)

Parameter

Parameter Description

Parameter Value

SESSION-ID

mirror session number

1 - 3

source interface IFNAME

mirror source interface

Support aggregation and physical interfaces

both

monitor received and transmitted traffic on that interface

-

rx

monitor received traffic only on that interface

-

tx

monitor transmitted traffic only on that interface

-

Command Mode

Global Config

Default

None

Usage

The mirror source interface can be either physical port or Aggregator interface. (e.g. eth-0-1, agg1).

If the parameter for direction [bothrx] is not specified, the default value is both.

Examples

This example shows how to remove this setting.:

Switch# configure terminal
Switch(config)# monitor session 1 source interface eth-0-11

This example shows how to remove this setting:

Switch# configure terminal
Switch(config)# no monitor session 1 source interface eth-0-11

Related Commands

monitor session SESSION-ID destination

show monitor

2.15.6. monitor session source vlan

Command Purpose

Use this command to set mirror source vlan.

To remove this setting, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

monitor session SESSION-ID source vlan VLAN-ID (both|tx|rx)

no monitor session SESSION-ID source vlan VLAN-ID (both|tx|rx)

Parameter

Parameter Description

Parameter Value

SESSION-ID

mirror session number

1 - 3

VLAN-ID

The source vlan ID to be mirrored

1 - 4094

both

Monitor received and transmitted traffic on that interface

-

rx

Monitor received traffic only on that interface

-

tx

Monitor transmitted traffic only on that interface

-

Command Mode

Global Config

Default

None

Usage

If the parameter for direction (bothrx) is not specified, the default value is both.

Before configure the monitor session source VLAN, User should create VLAN by command “vlan database”, and create VLAN interface by command “interface vlan” first.

Examples

This example shows how to create VLAN and vlan interface:

Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# vlan 2
Switch(config-vlan)# exit
Switch(config)# interface vlan2
Switch(config-if)# exit

This example shows how to set the mirror source to vlan2 in session 1:

Switch# configure terminal
Switch(config)# monitor session 1 source vlan 2 both

This example shows how to set the mirror source to vlan2 in session 1 to monitor received traffic only:

Switch# configure terminal
Switch(config)# monitor session 1 source vlan 2 rx

This example shows how to set the mirror source to vlan2 in session 1 to monitor transmitted traffic only:

Switch# configure terminal
Switch(config)# monitor session 1 source vlan 2 tx

This example shows how to remove this setting:

Switch# configure terminal
Switch(config)# no monitor session 1 source vlan 2 both

This example shows how to delete vlan and vlan interface:

Switch# configure terminal
Switch(config)# no interface vlan2
Switch(config)# vlan database
Switch(config-vlan)# no vlan 2
Switch(config-vlan)# exit

Related Commands

monitor session destination

show monitor

vlan database

vlan VLAN-ID

interface vlan VLAN-ID

2.15.7. monitor session source cpu

Command Purpose

Use this command to set mirror source CPU.

To remove this setting, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

monitor session SESSION-ID source cpu (both|tx|rx)

no monitor session SESSION-ID source cpu (both|tx|rx)

Parameter

Parameter Description

Parameter Value

SESSION-ID

Mirror session number

1 - 3

cpu

Set CPU to be mirrored

-

both

Monitor received and transmitted traffic on that interface

-

rx

Monitor received traffic only on that interface

-

tx

Monitor transmitted traffic only on that interface

-

Command Mode

Global Config

Default

None

Usage

If the parameter for direction (bothrx) is not specified, the default value is both.

Mirror source CPU can only be configured in session 1.

Examples

This example shows how to set the mirror source to CPU in session 1:

Switch# configure terminal
Switch(config)# monitor session 1 source cpu both

This example shows how to set the mirror source to CPU in session 1 to monitor received traffic only:

Switch# configure terminal
Switch(config)# monitor session 1 source cpu rx

This example shows how to set the mirror source to CPU in session 1 to monitor transmitted traffic only:

Switch# configure terminal
Switch(config)# monitor session 1 source cpu tx

This example shows how to remove this setting:

Switch# configure terminal
Switch(config)# no monitor session 1 source cpu both

Related Commands

monitor session destination

show monitor

2.15.8. monitor session destination interface tunnel

Command Purpose

Use this command to set erspan mirror destination interface tunnel.

To remove this setting, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

monitor session SESSION-ID destination interface IFTUNNEL

no monitor session SESSION-ID destination interface IFTUNNEL

Parameter

Parameter Description

Parameter Value

SESSION-ID

Mirror session number

1 - 3

IFTUNNEL

ERSPAN monitor destination tunnel

0 - 1023

Command Mode

Global Config

Default

None

Usage

The destination tunnel and its mode should be created before configuring ERSPAN monitor destination.

The ERSPAN destination interface can only be a tunnel interface.

About tunnel configuration, please refer to #erspan_tunnel.

Examples

This example shows how to create the tunnel:

Switch# configure terminal
Switch(config)# interface tunnel
Switch(config-vlan)# tunnel mode erspan
Switch(config-vlan)# exit

This example shows how to set the ERSPAN mirror destination to tunnel1 in session 1:

Switch# configure terminal
Switch(config)# monitor session 1 destination interface tunnel1

This example shows how to remove this setting:

Switch# configure terminal
Switch(config)# no monitor session 1 destination

This example shows how to delete the tunnel:

Switch# configure terminal
Switch(config)# no interface tunnel1
Switch(config-vlan)# exit

Related Commands

monitor session SESSION-ID source interface

monitor session SESSION-ID source vlan

interface tunnel

tunnel mode mode

2.15.9. monitor session destination remote

Command Purpose

Use this command to set mirror remote destination vlan and interface.

To remove this setting, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

monitor session SESSION-ID destination remote vlan VLAN-ID interface IFNAME

no monitor session SESSION-ID destination remote vlan

Parameter

Parameter Description

Parameter Value

SESSION-ID

Mirror session number

1 - 3

VLAN-ID

Remote mirror destination VLAN ID

2 - 4094

IFNAME

The out-going interface for mirrored packets

Support aggregation and physical interfaces

Command Mode

Global Config

Default

None

Usage

The destination vlan should be created in vlan database.

The destination interface can be either physical port or Aggregator interface.

To prevent another copy of packets flood out from the destination outgoing port, user can remove the port from default vlan by command “switchport trunk allowed vlan remove 1”.

Examples

This example shows how to create the vlan:

Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# vlan 2
Switch(config-vlan)# exit

This example shows how to set the mirror remote destination VLAN to 2 and outgoing port to eth-0-1 in session 1:

Switch# configure terminal
Switch(config)# monitor session 1 destination remote vlan 2 interface eth-0-1

This example shows how to remove this setting:

Switch# configure terminal
Switch(config)# no monitor session 1 destination remote vlan

This example shows how to delete the vlan:

Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# no vlan 2
Switch(config-vlan)# exit

Related Commands

monitor session SESSION-ID source interface

monitor session SESSION-ID source vlan

vlan database

vlan VLAN-ID

2.15.10. monitor mac escape

Command Purpose

Use this command to set remote mirror MAC escape feature. When these escape entries are set, the packets with specified MAC-DA will not be mirrored to the remote destination VLAN when using Rspan (unsupport ERSPAN) .

To remove this setting, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

monitor mac escape MAC MASK

no monitor mac escape (MAC MASK| )

Parameter

Parameter Description

Parameter Value

MAC

MAC address

MAC address in HHHH.HHHH.HHHH format

MASK

MAC address mask

MAC address mask in HHHH.HHHH.HHHH format

Command Mode

Global Config

Default

None

Usage

Mac escape is used for remote mirror. It will not affect the result of local mirror.

If a MAC escape entry is set, the packet with this MAC destination can not be mirrored in remote mirror.

Command “no monitor mac escape “ should delete the specified entry.

Command “no monitor mac escape” should delete all entries.

Examples

This example shows how to set the mirror mac escape:

Switch# configure terminal
Switch(config)# monitor mac escape 00cc.1122.3344 ffff.ffff.0000

This example shows how to remove this setting:

Switch# configure terminal
Switch(config)# no monitor mac escape 00cc.1122.3344 ffff.ffff.0000

Related Commands

monitor session SESSION-ID destination remote

2.15.11. show monitor

Command Purpose

Use this command to show the information about monitor.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

show monitor (session SESSION-ID)

Parameter

Parameter Description

Parameter Value

SESSION-ID

Mirror session number

1 - 3

Command Mode

Privileged EXEC

Default

None

Usage

If session id is not specified, any configured sessions should be shown.

Examples

This example shows how to display the information about monitor:

Switch# show monitor
session 1
Session 1
----------
Status : Valid
Type : Local Session
Source Ports :
Receive Only :
Transmit Only :
Both : eth-0-2
Source VLANs :
Receive Only :
Transmit Only :
Both :
Destination Port : eth-0-1

Related Commands

monitor session SESSION-ID source interface

monitor session SESSION-ID source vlan

monitor session SESSION-ID source cpu

monitor session SESSION-ID destination interface

monitor session SESSION-ID destination remote

monitor session SESSION-ID destination cpu

2.15.12. show monitor mac escape

Command Purpose

Use this command to show mac escape settings for remote mirror.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

show monitor mac escape

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

This example shows how to display the information about monitor MAC escape:

Switch# show monitor mac escape
-------------------------------------------------------------
monitor rspan mac escape database
-------------------------------------------------------------
count : 1
-------------------------------------------------------------
Mac : 00:cc:11:22:33:44
Mask : ff:ff:ff:ff:00:00
-------------------------------------------------------------

Related Commands

monitor mac escape MAC MASK

2.15.13. monitor destination forwarding enable

Command Purpose

Use this command to set mirror destination port forwarding enable.

To remove this setting, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

monitor destination forwarding enable

no monitor destination forwarding enable

Command Mode

Global Config

Default

Disabled

Usage

If any mirror destination is configured, this feature can’t be changed.

Examples

This example shows how to set mirror destination forwarding enable:

Switch# configure terminal
Switch(config)# monitor destination forwarding enable

Related Commands

monitor session SESSION-ID destination

show monitor

2.15.14. monitor cpu set packet buffer

Command Purpose

Use this command to set mirror cpu buffer size, its default value is 1000 of packets.

To remove this setting, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

monitor cpu set packet buffer SIZE

no monitor cpu set packet buffer

Parameter

Parameter Description

Parameter Value

SIZE

buffer size in packets

1 - 1000, unit:packet

Command Mode

Global Config

Default

Default 1000

Usage

The mirror CPU buffer can store up to 1000 packets and the default value is 1000.

Examples

This example shows how to set mirror cpu buffer size:

Switch# configure terminal
Switch(config)# monitor cpu set packet buffer 50

Related Commands

show monitor cpu packet buffer size

2.15.15. monitor cpu capture packet

Command Purpose

Use this command to capture packets to be written in a text file from cpu memory buffer.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

monitor cpu capture packet ( start | stop )

Parameter

Parameter Description

Parameter Value

start

start capture

-

stop

stop captrue

-

Command Mode

Privileged EXEC

Default

stop

Usage

When start capturing packet, the cpu mirror packets will be written in a text file and the file name is assigned by system. The text file is stored in the directory of flash/mirror/.

Examples

This example shows how to start cpu capturing packets in a text file:

Switch# configure terminal
Switch(config)# monitor cpu capture packet start

This example shows how to stop cpu capturing packets in a text file:

Switch# configure terminal
Switch(config)# monitor cpu capture packet stop

Related Commands

pcap convert FILENAMEA FILENAMEB

2.15.16. monitor cpu capture strategy

Command Purpose

Use this command to set the trategy of capturing packets.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

monitor cpu capture strategy (replace|drop)

Parameter

Parameter Description

Parameter Value

replace

The oldest packet would be replaced by the latest packet when CPU mirror memory buffer is full

-

drop

The latest packet would be discard when CPU mirror memory buffer is full

-

Command Mode

Global Config

Default

replace

Usage

None

Examples

This example shows how to set CPU capture strategy as replace:

Switch# configure terminal
Switch(config)# monitor cpu capture strategy replace

This example shows how to set CPU capture strategy as drop:

Switch# configure terminal
Switch(config)# monitor cpu capture strategy drop

Related Commands

show monitor cpu capture strategy

2.15.17. show monitor cpu packet

Command Purpose

Use this command to show the mirror CPU packets in memory.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

show monitor cpu packet (all|PACKET-ID)

Parameter

Parameter Description

Parameter Value

all

Show all of mirror CPU packets in memory

-

PACKET-ID

Show the mirror CPU packets of user specifying

1 - 1000

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

This example shows how to display the all mirror CPU packets in memory:

Switch(config)# show monitor cpu packet all

Related Commands

monitor session SESSION-ID destination cpu

2.15.18. clear monitor cpu packet all

Command Purpose

Use this command to clear the mirror CPU packets in memory.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

clear monitor cpu packet all

Command Mode

Privileged EXEC

Default

None

Usage

Clear all the mirror CPU packets in memory.

Examples

This example shows how to clear all the mirror CPU packets in memory buffer:

Switch(config)# clear monitor cpu packet all

Related Commands

show monitor cpu packet (all|<1-1000>)

2.15.19. show monitor cpu packet buffer-size

Command Purpose

Use this command to show the buffer size of mirror CPU in memory.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

show monitor cpu packet buffer-size

Command Mode

Privileged EXEC

Default

None

Usage

It displays the mirror CPU buffer size in memory and the size intends the number of packets.

Examples

This example shows how to show the mirror CPU buffer size in memory:

Switch(config)# show monitor cpu packet buffer-size

Related Commands

monitor cpu set packet buffer <1-1000>

2.15.20. show monitor cpu capture strategy

Command Purpose

Use this command to show the current strategy of capturing packets.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

-

AQ-N5000

7.0

Base

-

AQ-N6000

7.0

Base

-

Command Syntax

show monitor cpu capture strategy

Command Mode

Privileged EXEC

Default

None

Usage

It display the current strategy of capturing mirror CPU packets in memory.

Examples

This example shows how to show the current capture strategy:

Switch(config)# show monitor cpu capture strategy

Related Commands

monitor cpu capture strategy (replace|drop)