14-Network Management and Monitoring Command Reference

HomeSupportResource CenterRoutersCR19000 Core SeriesCR19000 Core SeriesTechnical DocumentsReference GuidesCommand ReferencesH3C CR19000 Core Router Series Command References-E3521-5W10014-Network Management and Monitoring Command Reference
13-Mirroring commands
Title Size Download
13-Mirroring commands 81.03 KB

Port mirroring commands

display mirroring-group

Use display mirroring-group to display mirroring group information.

Syntax

display mirroring-group { group-id | all | local }

Views

Any view

Predefined user roles

network-admin

network-operator

mdc-admin

mdc-operator

Parameters

group-id: Specifies a mirroring group by its number. The value range for this argument is 1 to 72.

all: Specifies all mirroring groups.

local: Specifies local mirroring groups.

Usage guidelines

Mirroring group information includes the type, status, and content of a mirroring group. It is sorted by mirroring group number.

Examples

# Display information about all mirroring groups.

<Sysname> display mirroring-group all

Mirroring group 1:

    Type: Local

    Status: Active

    Sampler: samp (failed)

    Mirroring port: GigabitEthernet1/2/0/1 Inbound cpu-packet

      Monitor port: GigabitEthernet1/2/0/2

Table 1 Command output

Field

Description

Mirroring group

Number of the mirroring group.

Type

Type of the mirroring group. Only local mirroring groups are supported.

Status

Status of the mirroring group:

·     Active—The mirroring group has taken effect.

·     Incomplete—The mirroring group configuration is not complete and does not take effect.

Sampler

Sampler name.

·     If the mirroring group failed to use the sampler, this field displays sampler-name (failed).

·     If no sampler is configured, this field is not displayed.

Mirroring port

Source port, which might be followed by the following keywords:

·     Both—Mirrors both the received and the sent packets of the interface.

·     Inbound—Mirrors the received packets of the interface.

·     Outbound—Mirrors the sent packets of the interface.

·     cpu-packet—Mirrors only the protocol packets received or sent by the CPU of the device.

Monitor port

Destination port.

 

mirroring-group

Use mirroring-group to create a mirroring group.

Use undo mirroring-group to delete mirroring groups.

Syntax

mirroring-group group-id local [ sampler sampler-name ]

undo mirroring-group { group-id | all | local }

Default

No mirroring groups exist.

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

group-id: Specifies a mirroring group by its number in the range of 1 to 72.

local: Specifies local mirroring groups.

all: Specifies all mirroring groups.

sampler sampler-name: Specifies a sampler to be used by its name. The sampler-name argument is a case-insensitive string of 1 to 31 characters.

Usage guidelines

A sampler selects a packet from sequential packets. Port mirroring uses the sampler to limit the volume of traffic to be mirrored. You can specify a sampler that has not been created for a mirroring group. If you configure multiple samplers for a mirroring group, the most recent configuration takes effect. For more information about samplers, see Network Management and Monitoring Configuration Guide.

Examples

# Create local mirroring group 1.

<Sysname> system-view

[Sysname] mirroring-group 1 local

mirroring-group mirroring-port (interface view)

Use mirroring-group mirroring-port to configure a port as a source port for a mirroring group.

Use undo mirroring-group mirroring-port to restore the default.

Syntax

mirroring-group group-id mirroring-port { both | inbound | outbound } [ cpu-packet ]

undo mirroring-group group-id mirroring-port

Default

A port does not act as a source port for any mirroring groups.

Views

Interface view

Predefined user roles

network-admin

mdc-admin

Parameters

group-id: Specifies a mirroring group by its number. The specified mirroring group must already exist. The value range for this argument is 1 to 72.

both: Mirrors both received and sent packets.

inbound: Mirrors only received packets.

outbound: Mirrors only sent packets.

cpu-packet: Mirrors only protocol packets sent or received by the CPU of the device. If you do not specify this keyword, all packets are mirrored. Support for this keyword depends on the device model.

Usage guidelines

A port can act as a source port for multiple mirroring groups, but one direction of a port cannot be used by multiple mirroring groups.

A source port cannot be used as a monitor port.

Examples

# Create local mirroring group 1 to monitor the bidirectional traffic of GigabitEthernet 1/2/0/1.

<Sysname> system-view

[Sysname] mirroring-group 1 local

[Sysname] interface gigabitethernet 1/2/0/1

[Sysname-GigabitEthernet1/2/0/1] mirroring-group 1 mirroring-port both

Related commands

mirroring-group

mirroring-group mirroring-port (system view)

Use mirroring-group mirroring-port to configure source ports for a mirroring group.

Use undo mirroring-group mirroring-port to remove source ports from a mirroring group.

Syntax

mirroring-group group-id mirroring-port interface-list { both | inbound | outbound } [ cpu-packet ]

undo mirroring-group group-id mirroring-port interface-list

Default

No source port is configured for a mirroring group.

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

group-id: Specifies a mirroring group by its number. The specified mirroring group must already exist. The value range for this argument is 1 to 72.

interface-list: Specifies a space-separated list of up to eight port items. Each item specifies a single port or a port range in the form of interface-type interface-number1 to interface-type interface-number2. The specified interfaces must be of the same type and on the same slot. The value for the interface-number2 argument must be equal to or greater than the value for the interface-number1 argument.

both: Mirrors both received and sent packets.

inbound: Mirrors only received packets.

outbound: Mirrors only sent packets.

cpu-packet: Mirrors only protocol packets sent or received by the CPU of the device. If you do not specify this keyword, all packets are mirrored. Support for this keyword depends on the device model.

Usage guidelines

A port can act as a source port for multiple mirroring groups, but one direction of a port cannot be used by multiple mirroring groups.

A source port cannot be used as a monitor port.

Examples

# Create local mirroring group 1 to monitor the bidirectional traffic of GigabitEthernet 1/2/0/1.

<Sysname> system-view

[Sysname] mirroring-group 1 local

[Sysname] mirroring-group 1 mirroring-port gigabitethernet 1/2/0/1 both

Related commands

mirroring-group

mirroring-group monitor-port (interface view)

Use mirroring-group monitor-port to configure a port as a monitor port for a mirroring group.

Use undo mirroring-group monitor-port to restore the default.

Syntax

mirroring-group group-id monitor-port

undo mirroring-group group-id monitor-port

Default

A port does not act as a monitor port for any mirroring groups.

Views

Interface view

Predefined user roles

network-admin

mdc-admin

Parameters

group-id: Specifies a mirroring group by its number. The specified mirroring group must already exist. The value range for this argument is 1 to 72.

Usage guidelines

Use a monitor port only for port mirroring, so the data monitoring device receives and analyzes only the mirrored traffic.

The member port of an existing mirroring group cannot be configured as a monitor port.

The source port of an existing mirroring group cannot be configured as a monitor port.

Examples

# Create local mirroring group 1 and configure GigabitEthernet 1/2/0/1 as its monitor port.

<Sysname> system-view

[Sysname] mirroring-group 1 local

[Sysname] interface gigabitethernet 1/2/0/1

[Sysname-GigabitEthernet1/2/0/1] mirroring-group 1 monitor-port

Related commands

mirroring-group

mirroring-group monitor-port (system view)

Use mirroring-group monitor-port to configure the monitor ports for a mirroring group.

Use undo mirroring-group monitor-port to remove the monitor ports from a mirroring group.

Syntax

mirroring-group group-id monitor-port interface-list

undo mirroring-group group-id monitor-port interface-list

Default

No monitor port is configured for a mirroring group.

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

group-id: Specifies a mirroring group by its number. The specified mirroring group must already exist. The value range for this argument is 1 to 72.

interface-list: Specifies a space-separated list of up to eight port items. Each item specifies a single port or a port range in the form of interface-type interface-number1 to interface-type interface-number2. The value for the interface-number2 argument must be equal to or greater than the value for the interface-number1 argument.

Usage guidelines

Use a monitor port only for port mirroring, so the data monitoring device receives only the mirrored traffic.

The member port of an existing mirroring group cannot be configured as a monitor port.

The source port of an existing mirroring group cannot be configured as a monitor port.

Examples

# Create local mirroring group 1 and configure GigabitEthernet 1/2/0/1 as its monitor port.

<Sysname> system-view

[Sysname] mirroring-group 1 local

[Sysname] mirroring-group 1 monitor-port gigabitethernet 1/2/0/1

# Create local mirroring group 3 and configure ports GigabitEthernet 1/2/0/1 through GigabitEthernet 1/2/0/3 and GigabitEthernet 1/2/0/5 as its monitor ports.

<Sysname> system-view

[Sysname] mirroring-group 3 local

[Sysname] mirroring-group 3 monitor-port gigabitethernet 1/2/0/1 to gigabitethernet 1/2/0/3 gigabitethernet 1/2/0/5

Related commands

mirroring-group


Flow mirroring commands

mirror-to cpu

Use mirror-to cpu to configure a mirroring action that mirrors traffic to the CPU.

Use undo mirror-to cpu to delete the mirroring action that mirrors traffic to the CPU.

Syntax

mirror-to cpu

undo mirror-to cpu

Default

No mirroring action exists to mirror traffic to the CPU.

Views

Traffic behavior view

Predefined user roles

network-admin

mdc-admin

Examples

# Create traffic behavior 1 and configure the action of mirroring traffic to the CPU for the traffic behavior.

<Sysname> system-view

[Sysname] traffic behavior 1

[Sysname-behavior-1] mirror-to cpu

mirror-to interface

Use mirror-to interface to configure a mirroring action that mirrors traffic to an interface.

Use undo mirror-to interface to delete a mirroring action that mirrors traffic to an interface.

Syntax

mirror-to interface interface-type interface-number [ sampler sampler-name ]

undo mirror-to interface interface-type interface-number

Default

No mirroring actions exist to mirror traffic to interfaces.

Views

Traffic behavior view

Predefined user roles

network-admin

mdc-admin

Parameters

interface-type interface-number: Mirrors traffic to an interface specified by its type and number.

sampler sampler-name: Specifies a sampler by its name. The sampler-name argument is a case-insensitive string of 1 to 31 characters.

Usage guidelines

You can execute this command multiple times for a traffic behavior to mirror traffic to different interfaces.

A sampler selects a packet from sequential packets. Flow mirroring uses a sampler to limit the volume of traffic to be mirrored. It supports using a sampler that has not been created. If you configure multiple samplers for a mirroring action, the most recent configuration takes effect. For more information about samplers, see Network Management and Monitoring Configuration Guide.

Examples

# Create traffic behavior 1 and configure the action of mirroring traffic to GigabitEthernet 1/2/0/1 for the traffic behavior.

<Sysname> system-view

[Sysname] traffic behavior 1

[Sysname-behavior-1] mirror-to interface gigabitethernet 1/2/0/1

# Create traffic behavior 1, configure the action of mirroring traffic to GigabitEthernet 1/2/0/1, and use sampler samp.

<Sysname> system-view

[Sysname] traffic behavior 1

[Sysname-behavior-1] mirror-to interface gigabitethernet 1/2/0/1 sampler samp

mirror-to local

Use mirror-to local to configure a mirroring action that mirrors traffic to the slot where the traffic was received or sent out.

Use undo mirror-to local to delete the mirroring action that mirrors traffic to the slot where the traffic was received or sent out.

Syntax

mirror-to local [ sampler sampler-name ]

undo mirror-to local

Default

No mirroring actions exist to mirror traffic to the slot where the traffic was received or sent out.

Views

Traffic behavior view

Predefined user roles

network-admin

mdc-admin

Parameters

sampler sampler-name: Specifies a sampler by its name, a case-insensitive string of 1 to 31 characters.

Usage guidelines

Packets that match the QoS policy configured with this mirroring action are copied to the slot to which the interface where the packets were captured belongs.

A sampler selects a packet from sequential packets. Flow mirroring uses a sampler to limit the volume of traffic to be mirrored. It supports using a sampler that has not been created. If you configure multiple samplers for a mirroring action, the most recent configuration takes effect. For more information about samplers, see Network Management and Monitoring Configuration Guide.

Examples

# Create traffic behavior 1 and configure the action of mirroring traffic to the slot where the traffic was received or sent out.

<Sysname> system-view

[Sysname] traffic behavior 1

[Sysname-behavior-1] mirror-to local

mirror-to slot

Use mirror-to slot to configure a mirroring action that mirrors traffic to a card.

Use undo mirror-to slot to delete a mirroring action that mirrors traffic to a card.

Syntax

mirror-to chassis chassis-number slot slot-number [ sampler sampler-name ]

undo mirror-to chassis chassis-number slot slot-number

Default

No mirroring actions exist to mirror traffic to cards.

Views

Traffic behavior view

Predefined user roles

network-admin

mdc-admin

Parameters

sampler sampler-name: Specifies a sampler by its name, a case-insensitive string of 1 to 31 characters.

chassis chassis-number slot slot-number: Specifies a card on a cluster member device. The chassis-number argument represents the member ID of the cluster member device. The slot-number argument represents the slot number of the card.

Usage guidelines

If you execute this command for a traffic behavior multiple times, the most recent configuration takes effect.

A sampler selects a packet from sequential packets. Flow mirroring uses a sampler to limit the volume of traffic to be mirrored. It supports using a sampler that has not been created. If you configure multiple samplers for a mirroring action, the most recent configuration takes effect. For more information about samplers, see Network Management and Monitoring Configuration Guide.

Examples

# Create traffic behavior 1 and configure the action of mirroring traffic to the specified slot by using sampler samp.

<Sysname> system-view

[Sysname] traffic behavior 1

[Sysname-behavior-1] mirror-to chassis 1 slot 1 sampler samp

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网