Cisco ASR 9000 Series Aggregation Services Router Interface and Hardware Component Command Reference, Release 5.1.x
Traffic Mirroring Commands on the Cisco ASR 9000 Series Router
Downloads: This chapterpdf (PDF - 1.34MB) The complete bookPDF (PDF - 8.65MB) | Feedback

Traffic Mirroring Commands on the Cisco ASR 9000 Series Router

This module describes the commands used to configure and monitor traffic mirroring.

acl

To configure ACL-based traffic mirroring, use the acl command in monitor session configuration mode. To stop ACL-based traffic mirroring, use the no form of this command.

acl

Syntax Description

This command has no keywords or arguments.

Command Default

No default behavior or values

Command Modes

Monitor session configuration

Command History

Release

Modification

Release 4.0.0

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

If you use the acl command, traffic is mirrored according to the definition of the global interface access list (ACL) defined in one of the following commands: ipv4 access-list, ipv6 access-list, ethernet-services access-list.

Even when the acl command is configured on the source mirroring port, if the ACL configuration command does not use the capture keyword, no traffic gets mirrored.

If the ACL configuration uses the capture keyword, but the acl command is not configured on the source port, although traffic is mirrored, no access list configuration is applied.

Examples

This example shows how to configure ACL-based traffic mirroring on the interface:

RP/0/RSP0/CPU0:router(config)# monitor-session tm_example 
RP/0/RSP0/CPU0:router(config)# ethernet-services access-list tm_filter 
RP/0/RSP0/CPU0:router(config-es-acl)# 10 deny 0000.1234.5678 0000.abcd.abcd any capture 
RP/0/RSP0/CPU0:router(config-es-acl)# exit 
RP/0/RSP0/CPU0:router(config)# interface GigabitEthernet0/2/0/0 
RP/0/RSP0/CPU0:router(config-if)# monitor-session tm_example direction rx-only 
RP/0/RSP0/CPU0:router(config-if)# acl 
RP/0/RSP0/CPU0:router(config-if)# l2transport 
RP/0/RSP0/CPU0:router(config-if-l2)# exit 
RP/0/RSP0/CPU0:router(config-if)# ethernet-services access-group tm_filter ingress 
RP/0/RSP0/CPU0:router(config-if)# end 

Related Commands

Command

Description

ethernet-services access-list

Defines an Ethernet services (Layer 2) access list by name.

ipv4 access-list

Defines an IPv4 access list by name.

ipv6 access-list

Defines an IPv6 access list by name.

clear monitor-session counters

To clear the traffic mirroring session statistics, use the clear monitor-session counters command in EXEC mode.

clear monitor-session counters [ interface type interface-path-id ]

Syntax Description

interface

Identifies the interface for which the counters are to be cleared.

type

Interface type. For more information, use the question mark (?) online help function.

interface-path-id

Physical interface or virtual interface.

Note   

Use the show interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (?) online help function.

session-name

Name of the monitor session to clear.

Command Default

All stored statistics for all interfaces are cleared.

Command Modes

EXEC

Command History

Release

Modification

Release 3.9.1

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Task ID

Task ID

Operations

interface

read

Examples

This example shows how to clear the traffic mirroring statistic counters:

 RP/0/RSP0/CPU0:routerclear monitor-session counters
   

destination interface

To associate a destination interface with a traffic mirroring session, use the destination interface command in monitor session configuration mode. To remove the designated destination, use the no form of this command.

destination interface type interface-path-id

no destination interface type interface-path-id

Syntax Description

type

Interface type. For more information, use the question mark (?) online help function.

interface-path-id

Physical interface or virtual interface.

Note   

Use the show interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (?) online help function.

Command Default

No default behavior or values

Command Modes

Monitor sessions configuration

Command History

Release

Modification

Release 3.9.1

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Use the destination interface command to assign a traffic monitoring session to a specific destination interface. This is the port to which a network analyzer is connected. This is generally called the monitoring port.

A destination port has these characteristics:

  • A destination port must reside on the same switch as the source port.
  • A destination port can be any Ethernet physical port or EFP, but not a bundle interface.
  • At any one time a destination port can participate in only one traffic mirroring session. A destination port in one traffic mirroring session cannot be a destination port for a second traffic mirroring session. In other words, no two monitor sessions can have the same destination port.
  • A destination port cannot also be a source port.

Examples

The following example shows how to configure a monitoring port for a traffic mirroring session:

RP/0/RP0/CPU0:router(config)# monitor-session mon1 
RP/0/RSP0/CPU0:router(config-mon)# destination interface gigabitethernet0/0/0/15 
   

destination pseudowire

To direct mirrored traffic to a pseudowire, use the destination pseudowire command in monitor session configuration mode. To remove the pseudowire designation, use the no form of this command.

destination pseudowire

no destination pseudowire

Syntax Description

This command has no keywords or arguments.

Command Default

No default behavior or values

Command Modes

Monitor session configuration

Command History

Release

Modification

Release 4.0.0

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Use the destination pseudowire command to direct the mirrored traffic to a pseudowire. A network analyzer in a central location can then be used to monitor the traffic. Use the monitor-session (l2vpn) command to define the exact pseudowire to which the monitored traffic should be replicated.

Examples

The following example shows how to configure a monitoring port for a traffic mirroring session:

RP/0/RP0/CPU0:router(config)# monitor-session mon1 
RP/0/RSP0/CPU0:router(config-mon)# destination pseudowire 
   

Related Commands

Command

Description

monitor-session (l2vpn)

Attaches a traffic monitoring session as one of the segments for a cross connect.  

mirror first

To configure partial traffic mirroring, use the mirror first command in monitor session configuration mode. To stop mirroring a portion of the packet, use the no form of this command.

mirror first bytes

Syntax Description

bytes

Number of bytes mirrored. The mirrored packet length value can range from 65 to 128.

Command Default

The entire packet is mirrored.

Command Modes

Monitor session configuration

Command History

Release

Modification

Release 4.0.0

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Use the mirror first command to mirror the first 64 to 128 bytes of the packet. The actual mirrored packet is the configured partial packet monitoring size plus the 4-byte trailing CRC.

Examples

This example shows how to mirror the first 100 bytes of the packet:

RP/0/RSP0/CPU0:router(config)# interface gigabitethernet0/0/0/11 
RP/0/RSP0/CPU0:router(config-if)# monitor-session mon1 
RP/0/RSP0/CPU0:router(config-if-mon)# mirror first 100 
  

Related Commands

Command

Description

monitor-session

Defines a traffic mirroring session and enter monitor session configuration mode.  

monitor-session

To define a traffic mirroring session and enter monitor session configuration mode, use the monitor-session command in global configuration mode. To remove the traffic mirroring session, use the no form of this command.

monitor-session session-name

no monitor-session session-name

Syntax Description

session-name

Name of the monitor session to configure.

Command Default

No default behavior or values

Command Modes

Global configuration

Command History

Release

Modification

Release 3.9.1

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Before you can assign a monitor session to a specific interface, you must configure it using the monitor-session command. The session-name should not be the same as any interface name.

In monitor session configuration mode, you should define the destination interface to be used in the traffic mirroring session using the destination command.

Examples

This example shows how to enter monitor session configuration mode:

RP/0/RSP0/CPU0:router(config)# monitor-session mon1
RP/0/RSP0/CPU0:router(config-mon)#
   

Related Commands

Command

Description

destination interface

Associates a destination interface with a traffic mirroring session.  

monitor-session (interface)

To associate a traffic mirroring session with a specific interface, use the monitor-session command in interface configuration mode or dynamic-template configuration mode. To remove the association between a traffic mirroring session and an interface, use the no form of this command.

monitor-session session-name [ direction { rx-only | tx-only } ]

no monitor-session session-name [ direction { rx-only | tx-only } ]

Syntax Description

session-name

Name of the monitor session to configure.

direction

Specifies that traffic replication is in only one direction.

rx-only

Specifies that only ingress traffic is replicated.

tx-only

Specifies that only egress traffic is replicated.

Command Default

Replicates both ingress and egress traffic.

Command Modes

Interface configuration

Dynamic template configuration (for BNG)

Command History

Release

Modification

Release 3.9.1

This command was introduced.

Release 4.0.0

The acl and mirror first keywords were added.

Release 5.1

The support for this command under dynamic-template configuration mode was added for BNG.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Before you can associate a traffic mirroring session to a specific interface, you must define it using the monitor-session global configuration command. After the traffic mirroring session is defined, use the monitor-session interface configuration command or dynamic template configuration command to associate this session with a specific source interface. For BNG sessions, the subscriber is attached to the monitor session, only when the dynamic template is applied to the subscriber. When the session is associated, all specified traffic on the interface is then replicated to the destination location defined in the monitor session configuration.

The monitor-session interface configuration command also enters monitor session configuration mode for you to configure additional features of the mirroring session.

Task ID

Task ID

Operations

interface

read, write

config-services

read, write

Examples

This example shows how to enter monitor session configuration mode:

RP/0/RSP0/CPU0:router# configure 
RP/0/RSP0/CPU0:router(config)# interface gigabitethernet0/0/0/11
RP/0/RSP0/CPU0:router(config-if)# l2transport 
RP/0/RSP0/CPU0:router(config-if-l2)# monitor-session mon1
RP/0/RSP0/CPU0:router(config-if-mon)#
   

This example shows how to configure monitor-session command in the dynamic-template configuration mode for BNG:

RP/0/RSP0/CPU0:router# configure 
RP/0/RSP0/CPU0:router(config)# dynamic-template type ppp ppp_template
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# monitor-session mon1 direction rx-only 
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# acl
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# mirror first 100

Related Commands

Command

Description

monitor-session

Defines a traffic mirroring session and enter monitor session configuration mode.  

show monitor-session status

To display status information about configured traffic mirroring sessions, use the show monitor-session status command in EXEC mode.

show monitor-session [session-name] status [detail] [errors]

Syntax Description

session-name

Name of the monitor session to configure.

detail

Displays the full error string for any errors.

errors

Displays all sessions, but only source interfaces with errors are displayed (if no source interfaces have errors, then 'No errors' is displayed).

Command Default

No default behavior or values

Command Modes

EXEC

Command History

Release

Modification

Release 3.9.1

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

The show monitor-sessions status command displays the following information:

  • Destination information for the session (including the name of the interface).
  • Destination status (interface state).
  • List of source interfaces.
  • Any other status information that may be pertinent, such as a software or hardware error that would stop sessions operating correctly. If an error is returned from interactions with another component, then the full error string is only displayed in detail output; standard tabular output reports that there has been an error but refers the user to the detailed output.

Examples

This example shows sample output from the show monitor-session status command:

RP/0/RSP0/CPU0:router# show monitor-session status 

Monitor-session foo
Destination interface GigabitEthernet 0/0/0/0
================================================================================
Source Interface      Dir   Status
--------------------- ----  ----------------------------------------------------
Gi0/1/0/0.10          Both  Operational
Gi0/1/0/0.11          Rx    Operational
Gi0/1/0/0.12          Tx    Operational
   

show monitor-session counters

To display statistics regarding traffic mirroring sessions, use the show monitor-session counters command in EXEC mode.

show monitor-session [session-name] counters

Syntax Description

session-name

Name of the monitor session to configure.

Command Default

No default behavior or values

Command Modes

EXEC

Command History

Release

Modification

Release 3.9.1

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

The show monitor-sessions counters command displays a list of all source interfaces, and the replicated packet statistics for each interface. The full set of statistics displayed for each interface is:

  • Ingress replicated packets and octets
  • Egress replicated packets and octets
  • Non-replicated packets and octets

Examples

This example shows sample output from the show monitor-session counters command:

RP/0/RSP0/CPU0:router show monitor-session 2 counters 

Monitor session 2
  GigabitEthernet 0/3/0/0.100:
    Rx Replicated: 100 Packets 8000 Bytes
    Tx Replicated: 2 Packets 3000 Bytes
    Non Replicated: 0 Packets 0 Bytes