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

Fit AP V200R010C00 Command Reference

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).
capture-packet

capture-packet

Function

The capture-packet command captures service packets matching specified rules, displays captured packet information on the terminal, or saves the captured packets on the local device.

By default, the captured packets on the device are not configured.

Format

capture-packet interface interface-type interface-number [ acl acl-number ] destination { terminal | file file-name } * [ car cir car-value | time-out time | packet-num number | packet-len length ] *

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.

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 63 characters without spaces.

car cir car-value

Specifies the rate at which packets are captured.

The value is an integer that ranges from 1 to 256, in pps. The default value is 64 pps.

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 64, in bytes. The default value is 64 bytes.

Views

System view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

If an error occurs in service traffic forwarding (for example, the traffic status does not match the traffic model), it is recommended that you configure the device to capture service packets for analysis so that the device can quickly identify invalid packets. This function ensures correct data transmission on the network.

Precautions

The device can capture only incoming packets and cannot capture outgoing packets.

Before using the capture-packet command again, wait until the last command execution is complete.

The system limits the rate of captured packets. If the rate of packets exceeds the limit, some packets may be discarded.

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 the interface GE0/0/1 and display them on the terminal.

<Huawei> system-view
[Huawei] capture-packet interface gigabitethernet 0/0/1 destination terminal time-out 10
Warning: Captured packets will be showed on terminal. 
[Huawei]
  Packet: 1
  -------------------------------------------------------
  ff ff ff ff ff ff 00 e0 fc 01 00 08 08 06 00 01
  08 00 06 04 00 01 00 e0 fc 01 00 08 02 01 01 03
  00 00 00 00 00 00 0a 01 01 01 00 00 00 00 00 00
  00 00 00 00 00 00 00 00 00 00 00 00
  -------------------------------------------------------

  ------------------capture report-----------------------
  file: NULL
  interface: GigabitEthernet0/0/1
  acl: -
  car: 64pps timeout: 10s
  packets: 100 (expected) 1 (actual)
  length: 64 (expected)                
  -------------------------------------------------------
Table 15-11  Description of the capture-packet command output

Item

Description

file

Local path that stores captured packets.

interface

Interface where packets are captured.

acl

ACL number.

car

Rate of captured packets.

timeout

Timeout interval of packet capture. The system stops capturing packets after the specified time interval.

packets

Expected number and actual number of captured packets.

length

Length of captured packets.

Translation
Download
Updated: 2019-07-18

Document ID: EDOC1100064353

Views: 126147

Downloads: 98

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