No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Command Reference

CloudEngine 8800, 7800, 6800, and 5800 V200R002C50

This document describes all the configuration commands of the device, including the command function, syntax, parameters, views, default level, usage guidelines, examples, and related commands.
Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Packet Capture Configuration Command

Packet Capture Configuration Command

NOTE:
Based on your requirements to detect failures in telecom transmission, this feature may collect or store some communication information about specific customers. Huawei cannot offer services to collect or store this information unilaterally. Before enabling the function, ensure that it is performed within the boundaries permitted by applicable laws and regulations. Effective measures must be taken to ensure that information is securely protected.

capture-packet interface

Function

The capture-packet interface command configures an instance for capturing forwarded packets.

The undo capture-packet command deletes the configured capture instance.

By default, no instance is configured for capturing forwarded packets.

Format

capture-packet interface { interface-type interface-number } &<1-4> [ vxlan [ vni vni-id ] [ tag-format { none | single } ] [ acl acl-number ] | [ vlan vlan-id | inner-vlan inner-vlan-id | acl { acl-number | ipv6 acl6-number } ] * ] [ clear payload ] destination { terminal | file file-name } * [ time-out time | packet-num number | packet-len { length | total-packet } ] *

undo capture-packet [ capture-index ]

NOTE:

Only the CE8860EI, CE8850EI, CE7855EI, CE7850EI, CE6880EI, CE6870EI, CE6860EI, CE6856HI, CE6855HI, CE6851HI, CE6850HI, and CE6850U-HI can capture VXLAN packets when the original Ethernet frame information in the VXLAN packets matching the specified conditions.

Only the CE6870EI does not support the inner-vlan inner-vlan-id parameter.

Parameters

Parameter

Description

Value

interface-type interface-number

Captures packets on a specified interface.
  • interface-type specifies the interface type.
  • interface-number specifies the interface number.

-

vxlan

Captures the VXLAN packets in which the original Ethernet frame information matches the specified conditions.

-

vni vni-id

Captures the VXLAN packets matching the specified VNI.

The value is an integer ranging from 1 to 16000000.

tag-format { none | single }

Indicates whether to capture the VXLAN packets in which the original Ethernet frames contain tags:
  • none: captures the VXLAN packets in which the original Ethernet frames do not contain tag.
  • single: captures the VXLAN packets in which the original Ethernet frames contain a single tag.

-

acl acl-number

Captures the VXLAN packets in which the original Ethernet frames match the specified ACL rules.

The ACL rule can specify only the source MAC address, Ethernet frame type, destination IP address, source IP address, destination port number, and source port number. If the ACL rules specify other options, the VXLAN packets cannot be captured.

The value is an integer that ranges from 2000 to 4999.

vlan vlan-id

Captures packets from a specified VLAN.

The value of vlan-id is an integer that ranges from 1 to 4094.

inner-vlan inner-vlan-id

Captures packets with a specified inner VLAN ID.

The value of vlan-id is an integer that ranges from 1 to 4094.

acl

Configures an ACL.

-

acl-number

Captures packets matching a specified ACL.

The value is an integer that ranges from 2000 to 4999.

ipv6

Configures an ACL6.

-

acl6-number

Captures packets matching a specified ACL6.

The value is an integer that ranges from 2000 to 3999.

clear payload

Sets the data content in captured packets to 0.

NOTE:

The data content of only the TCP and UDP packets can be set to 0.

-

destination

Indicates the destination to which captured packet information is sent.

-

terminal

Displays captured packet information on a terminal.

-

file file-name

Saves captured packet information to a file. The file name extension must be .cap.

The value is a string of 5 to 64 characters without spaces.

time-out time

Specifies the timeout period for capturing packets. The system stops capturing packets after the specified timeout period expires.

The value is an integer that ranges from 1 to 300, in seconds. By default, the timeout period is 60s.

packet-num number

Specifies the number of packets to be captured. The system stops capturing packets after the specified number of packets are captured.

The value is an integer that ranges from 1 to 1000. The default value is 100.

packet-len length

Specifies the length of captured packets that can be displayed on the terminal or stored on the storage medium.

The value is an integer that ranges from 20 to 16384, in bytes. The default value is 64 bytes.

total-packet

Displays the content of the entire packet on the terminal or stores the content of the entire packet on the storage medium.

-

capture-index

Deletes capture instance with a specified index.

The value is an integer that ranges from 1 to 8. To view the index of a packet capture instance, run the display capture-packet config-state command.

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

If the device fails to forward traffic correctly, for example, the traffic does not match the traffic model, configure the packet capture function to capture forwarded packets for analysis. This allows the device to process invalid packets in time, ensuring that network data can be transmitted correctly.

You can set packet capture parameters based on the number of packets on the interface. If a large number of packets are forwarded on an interface, set the time parameter to a small value and the number parameter to a large value. If a small number of packets are forwarded on an interface, set the time parameter to a large value and the number parameter to a small value.

Precautions

After the packet capture function is enabled, performance of the device may be affected. Exercise caution when you configure this function.

The device can capture only upstream packets and cannot capture downstream packets. The device supports only one instance for capturing incoming.

The device can capture packets on the physical ports of stack members, but cannot capture packets on stack ports.

The device cannot capture packets on Fabric-port or its member ports.

The CE6870EI does not support packet capture on member interfaces specified in an Eth-Trunk or M-LAG.

You can set the timeout period specified by time and the number of packets to be captured specified by number for a capture instance. If the timeout period expires or the specified number of packets are captured, the system stops capturing packets.

Example

# Capture packets on 10GE1/0/1 matching ACL 2000 and save captured packet information in the capture.cap file.

<HUAWEI> capture-packet interface 10ge 1/0/1 acl 2000 destination file capture.cap
# Capture packets on 10GE1/0/1 and 10GE1/0/2 and display packets information on the screen.
<HUAWEI> capture-packet interface 10ge 1/0/1 10ge 1/0/2 destination terminal
Warning: Capture-packet will be shown on terminal. 
<HUAWEI>
  -------------------------------------------------------

    Packet: 1 Interface: 10GE1/0/1

  -------------------------------------------------------

  04 f9 38 8d e6 82 30 6b 20 79 22 02 08 00 45 00

  00 54 10 01 00 00 fe 01 8e a2 0e 02 01 02 0e 01

  01 01 00 00 ed 1e 12 e0 00 01 00 00 00 00 00 00

  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

  -------------------------------------------------------

  Packet: 2 Interface: 10GE1/0/2

  -------------------------------------------------------

  04 f9 38 8d e6 82 00 19 74 59 33 02 08 00 45 00

  00 54 10 02 00 00 ff 01 8d a1 0e 01 01 01 0e 02

  01 02 08 00 e5 1d 12 e0 00 02 00 00 00 00 00 00

  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

  -------------------------------------------------------

  ------------------capture report-----------------------

  Capture-Packet Index 1
  Type        : forwarding
  Interface   : 10GE1/0/1
  Interface   : 10GE1/0/2
  Direction   : inbound
  Time-out    : 60 seconds
  Packet-num  : 100
  Packet-len  : 64
  BufferOnly  : disabled

  -------------------------------------------------------
Table 18-61  Description of the capture-packet interface command output

Item

Description

Capture-Packet Index

Index of a packet capture instance.

Type

Type of packet capture. forwarding indicates that forwarded packets are captured.

Interface

Interface name.

Direction

Direction of forwarded packets that are captured. The device can capture the forwarded packets in the ingress.

Time-out

Packet capture timeout.

Packet-num

Number of packets that can be captured.

Packet-len

Length of each captured packet.

BufferOnly

Whether to save the captured packets in buffer.

  • disabled: not save.
  • enabled: save.

capture-packet local-host

Function

The capture-packet local-host command configures an instance for capturing packets sent to the CPU.

The undo capture-packet command deletes the configured instance.

By default, no instance is configured for capturing packets sent to the CPU.

Format

capture-packet local-host [ interface { interface-type interface-number } &<1-4> ] [ acl { { acl-number | name acl-name } | ipv6 { acl6-number | name acl6-name } } | vlan vlan-id | inner-vlan inner-vlan-id ] * destination { terminal | file file-name } * [ time-out time | packet-num number | packet-len { length | total-packet } ] *

undo capture-packet [ capture-index ]

Parameters

Parameter

Description

Value

interface interface-type interface-number

Captures packets on a specified interface.
  • interface-type specifies the interface type.
  • interface-number specifies the interface number.

-

acl

Configures an ACL.

-

acl-number

Captures packets matching a specified ACL.

The value is an integer that ranges from 2000 to 4999.
  • The value of a basic ACL ranges from 2000 to 2999.
  • The value of an advanced ACL ranges from 3000 to 3999.
  • The value of a Layer 2 ACL ranges from 4000 to 4999.

name acl-name

Captures packets matching a specified ACL.

The value is a string of 1 to 32 case-sensitive characters except spaces. The value must start with a letter (case-sensitive).

ipv6

Configures an ACL6.

-

acl6-number

Captures packets matching a specified ACL6.

The value is an integer that ranges from 2000 to 3999.
  • The value of a basic ACL ranges from 2000 to 2999.
  • The value of an advanced ACL ranges from 3000 to 3999.

name acl6-name

Captures packets matching a specified ACL6.

The value is a string of 1 to 32 case-sensitive characters except spaces. The value must start with a letter (case-sensitive).

vlan vlan-id

Captures packets from a specified VLAN ID.

The value is an integer ranging from 1 to 4094, except reserved VLAN IDs, which can be configured using the vlan reserved command

inner-vlan inner-vlan-id

Captures packets with a specified outer VLAN ID.

The value is an integer ranging from 1 to 4094.

destination

Indicates the destination to which captured packet information is sent.

-

terminal

Displays captured packet information on a terminal.

-

file file-name

Saves captured packet information to a file. The file name extension must be .cap.

The value is a string of 5 to 64 characters without spaces.

time-out time

Specifies the timeout period for capturing packets. The system stops capturing packets after the specified timeout period expires.

The value is an integer that ranges from 1 to 3600, in seconds. By default, the timeout period is 15s.

packet-num number

Specifies the number of packets to be captured. The system stops capturing packets after the specified number of packets are captured.

The value is an integer that ranges from 1 to 1000. The default value is 10.

packet-len length

Specifies the length of captured packets that can be displayed on the terminal or stored on the storage medium.

The value is an integer that ranges from 20 to 16384, in bytes. The default length is 20 bytes.

total-packet

Displays the content of the entire packet on the terminal or stores the content of the entire packet on the storage medium.

-

capture-index

Deletes capture instance with a specified index.

The value is an integer that ranges from 1 to 8. To view the index of a packet capture instance, run the display capture-packet config-state command.

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

Devices on a network transmit various services, and network administrators often need to capture packets on devices to locate faults. The device does not support remote packet capture; therefore, administrators need to capture packets onsite by connecting a PC to the switch. If packets need to be captured on an optical interface, an optical-to-electrical converter must be installed on the interface, reducing maintenance efficiency. Running the capture-packet local-host command can remotely capture the packets to be sent to the CPU and analyze the captured packets, to greatly improve maintenance efficiency and reduce maintenance cost.

Precautions

Capturing forwarded packets and capturing packets sent to the CPU are independent of each other. The following are constraints on capturing packets to be sent to the CPU:

  • The device supports a maximum of eight capture instances.

  • The device can capture packets on the Eth-Trunk interface but cannot capture packets on a specified Eth-Trunk member interface.

  • In a packet capturing instance, the packets on a maximum of four interfaces can be captured. If you delete any interface from the instance or an interface goes Down, the entire instance is deleted.
  • If the ACL and VLAN parameters as well as the specified interfaces in an instance you want to configure are the same as those in an existing instance, the device considers that this instance has been enabled.

When configuring a capture instance, note the following two points:

  • The device can capture packets of various protocols sent to the CPU.

  • You can set the timeout period specified by time, number of captured packets specified by number, and number of capture instances. If the timeout period for capturing packets expires, the specified number of packets are captured, or the configured capture instance exceeds the limit, the system stops capturing packets.

Example

# Capture packets sent to the CPU on 10GE1/0/1, set the timeout period to 360s and number of packets to be captured to 100.

<HUAWEI> capture-packet local-host interface 10ge 1/0/1 destination file capture1.cap time-out 360 packet-num 100
Info: Capture-packet data will be saved to flash:/logfile/capture1.cap. 

display capture-packet config-state

Function

The display capture-packet config-state command displays packet capture information.

Format

display capture-packet config-state

Parameters

None

Views

All views

Default Level

3: Management level

Usage Guidelines

After the device is configured to capture the packets to be sent to the CPU or forwarded, you can run this command to view packet capturing status, parameters, and name of the saved packet capturing file during packet capturing.

Example

# Display packet capture information.

<HUAWEI> display capture-packet config-state
Capture-Packet Index 1
Type        : local-host
LinkType    : ethernet
Interface   : 10GE1/0/1
ACL         : 2001
File Name   : flash:/logfile/capture_host_all_GigabitEthernet_2012-05-03-14-44-01.cap
Time-out    : 3600 seconds
Packet-num  : 1000
Packet-len  : 64


Capture-Packet Index 2
Type        : forwarding
Interface   : 10GE1/0/2
Direction   : inbound
ACL         : 2001
File Name   : flash:/logfile/capture_fwd_GigabitEthernet3.0.0_2012-05-03-14-44-54.cap
Time-out    : 3600 seconds
Packet-num  : 900
Packet-len  : 62
Table 18-62  Description of the display capture-packet config-state command output

Item

Description

Capture-Packet Index

Index of a packet capture instance.

Type

Type of captured packets:
  • local-host: packets that are destined for the local device
  • forwarding: packets that are destined for a device other than the local one

LinkType

Link type.

Interface

Interface name.

Direction

Direction of forwarded packets.

ACL

ACL number.

File Name

Name of a file saving an instance.

Time-out

Timeout time before the system stops capturing packets.

Packet-num

Number of captured packets in a file.

Packet-len

Length of each packet in a file.

display capture-packet file

Function

The display capture-packet file command displays the content of a specified packet capture file.

Format

display capture-packet file file-name [ verbose ]

Parameters

Parameter Description Value
file-name Specifies the name of the packet capture file. The file-name must already exist, in the format of flash:/path name/file name.
verbose Specifies to display the detail information. -

Views

All views

Default Level

3: Management level

Usage Guidelines

After the device is configured to remotely capture packets, you can analyze the captured packets to check whether the data is correct and locate data problems. You do not need to download the packet capture files. Instead, you can run this command to view the content of the files.

The content of the packet header obtaining file is displayed in the command output as a hexadecimal character string. You can convert the content into a binary file and use the Wireshark to view the packet information.

Example

# Display information about the capture instance named capture_host_GE3.1.8_2013-05-09-10-45-57.cap.

<HUAWEI> display capture-packet file flash:/logfile/capture_host_GE3.1.8_2013-05-09-10-45-57.cap
a1 b2 c3 d4 00 02 00 04 00 00 00 00 00 00 00 00
00 00 ff ff 00 00 00 09 4d 10 36 db 00 0a d5 81
00 00 00 0c 00 00 00 0c ff 03 c0 21 09 9d 00 08
8a 8c bc c3 4d 10 36 db 00 0a d6 ae

# View details about a packet capture instance and set the packet capture file name to pingcapture.cap.

<HUAWEI> display capture-packet file flash:/logfile/pingcapture.cap verbose
packet NO        : 1
packet length is : 64
capture-time     : 2015-09-01 03:45:32
  L2 Type: Ethernet
    Source mac   : f84a-bff0-cac2
    Dest mac     : 0019-7459-3302
    Ethernet type/length: 0x0800

  L3 Type: IPv4
    Protocol Num : 1
    Source Ip    : 10.1.1.2
    Dest Ip      : 10.1.1.1


  L4 Type: ICMP
    Source Port  : -
    Dest Port    : -




00 19 74 59 33 02 f8 4a bf f0 ca c2 08 00 45 00 
00 54 08 01 00 00 ff 01 9d a3 0a 01 01 02 0a 01 
01 01 08 00 f3 be 04 40 00 01 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

packet NO        : 2
packet length is : 64
capture-time     : 2015-09-01 03:45:32
  L2 Type: Ethernet
    Source mac   : f84a-bff0-cac2
    Dest mac     : 0019-7459-3302
    Ethernet type/length: 0x0800

  L3 Type: IPv4
    Protocol Num : 1
    Source Ip    : 10.1.1.2
    Dest Ip      : 10.1.1.1


  L4 Type: ICMP
    Source Port  : -
    Dest Port    : -



                
00 19 74 59 33 02 f8 4a bf f0 ca c2 08 00 45 00 
00 54 08 02 00 00 ff 01 9d a2 0a 01 01 02 0a 01 
01 01 08 00 f3 bd 04 40 00 02 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Table 18-63  Description of the display capture-packet file flash:/logfile/pingcapture.cap verbose command output

Item

Description

packet NO

Packet sequence number in the packet capture file.

packet length is

Length of each packet in the packet capture file.

capture-time

Time when the packet with the specified sequence number is captured.

L2 Type

Layer 2 protocol type.

Source mac

Source MAC address.

Dest mac

Destination MAC address.

Ethernet type/length

Ethernet type.

L3 Type

Layer 3 protocol type.

Protocol Num

Protocol number.

Source Ip

Source IP address.

Dest Ip

Destination IP address.

L4 Type

Layer 4 protocol type.

Source Port

Source port number.

Dest Port

Destination port number.

Translation
Download
Updated: 2019-03-21

Document ID: EDOC1000166501

Views: 42849

Downloads: 328

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next