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

S12700 V200R013C00 Command Reference

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.

Command Support

Commands provided in this section and all the parameters in the commands are supported by all switch models by default, unless otherwise specified. For details, see specific commands.

capture-packet

Function

The capture-packet command captures service packets matching specified rules.

Format

capture-packet { interface interface-type interface-number | acl { ipv4-acl | ipv6 ipv6-acl } } * [ vlan vlan-id | cvlan cvlan-id ] * destination { file file-name | terminal } * [ car cir car-value | time-out time-out-value | packet-num number | packet-len length | { inbound | outbound } ] *

NOTE:

Only the X series cards support the inbound and outbound parameters. If the inbound and outbound parameters are not specified, the device captures incoming and outgoing packets on the interface. Other cards capture only incoming packets on the interface.

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 { ipv4-acl | ipv6 ipv6-acl }

Captures packets matching a specified ACL or ACL6.

NOTE:

The specified ACL or ACL6 must exist and contain ACL rules.

  • ipv4-acl: The value is an integer that ranges from 2000 to 5999.
  • ipv6 ipv6-acl: The value is an integer that ranges from 2000 to 3999.

vlan vlan-id

Captures packets from a specified VLAN.

The value is an integer that ranges from 1 to 4094.

cvlan cvlan-id

Captures packets with a specified inner VLAN ID.

The value is an integer that ranges from 1 to 4094.

destination

Indicates the destination to which captured packet information is sent.

-

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.

terminal

Displays captured packet information on a terminal.

-

car cir car-value

Specifies the rate at which packets are captured.

The value is an integer that ranges from 8 to 256, in kbit/s. The default value is 64 kbit/s.

time-out time-out-value

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.

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

inbound Captures incoming packets on the interface.

-

outbound Captures outgoing packets on the interface.

-

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

  • Currently, packets on the management interface cannot be captured.
  • If the IP addresses of ARP packets on the control plane match the IP addresses in a basic or advanced ACL, these ARP packets can also be captured.
  • The packet capture configuration is not saved in the configuration file, and becomes invalid when packet capture is complete.
  • Different packet capture instances cannot be executed simultaneously. That is, a new packet capture instance can be executed only when the previous one is complete.
  • The system limits the rate of captured packets. The default rate limit is 64 kbit/s. If the rate of packets exceeds the limit, some packets may be discarded.
  • The device cannot capture the packets of fast ICMP reply, BFD, 802.1ag and VBST.
  • If an interface on the X series cards is added to an Eth-trunk, the interface does not support packet capturing.
  • When the device discards the packets that it cannot forward, packets may not be captured in some situations. It is recommended that you obtain packets in other ways, such as mirroring.

Example

# Capture packets on the interface GigabitEthernet1/0/1, saves them to the capture.cap file, and display them on the terminal (on a card that supports capture of outgoing packets on an interface).

<HUAWEI> system-view
[HUAWEI] capture-packet interface gigabitethernet 1/0/1 destination file capture.cap terminal
[HUAWEI]                                                    
  Packet(inbound): 1
  -------------------------------------------------------
  ff ff ff ff ff ff 00 00 c1 02 01 02 81 00 00 58 
  08 00 45 00 00 52 00 00 00 00 40 72 c8 33 58 01 
  01 02 58 01 01 03 00 01 02 03 04 05 06 07 08 09 
  0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 
  -------------------------------------------------------

  Packet(outbound): 1
  -------------------------------------------------------
  ff ff ff ff ff ff 00 00 c1 02 01 02 08 00 45 00 
  00 52 00 00 00 00 40 72 c8 33 58 01 01 02 58 01 
  01 03 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 
  0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 
  -------------------------------------------------------

  -----------------packet getting report-----------------
  file:  flash:/capture.cap                                                    
  packets getting: interface GigabitEthernet1/0/1
  acl: -                                                                        
  vlan: -  cvlan: -                                                             
  car: 64kbps timeout: 60s                                                      
  packets: 100 (expected)
           1 (inbound actual) 1 (outbound actual)
  length: 64 (expected)                                                        
  ------------------------------------------------------- 

# Capture packets on the interface GigabitEthernet1/0/1, saves them to the capture.cap file, and display them on the terminal (on a card that does not support capture of outgoing packets on an interface).

<HUAWEI> system-view
[HUAWEI] capture-packet interface gigabitethernet 1/0/1 destination file capture.cap terminal
[HUAWEI]                                                    
  Packet: 1                                                                     
  -------------------------------------------------------                       
  01 80 c2 00 00 00 00 e0 09 87 78 90 81 00 00 01                               
  00 69 42 42 03 00 00 03 02 7c 80 00 00 e0 09 87                               
  78 90 00 00 00 00 80 00 00 e0 09 87 78 90 80 23                               
  00 00 14 00 02 00 0f 00 00 00 40 00 72 67 31 00                               
  -------------------------------------------------------                       
                                                                                
  Packet: 2                                                                     
  -------------------------------------------------------                       
  01 80 c2 00 00 00 00 e0 09 87 78 90 81 00 00 01                               
  00 69 42 42 03 00 00 03 02 7c 80 00 00 e0 09 87                               
  78 90 00 00 00 00 80 00 00 e0 09 87 78 90 80 23                               
  00 00 14 00 02 00 0f 00 00 00 40 00 72 67 31 00                               
  -------------------------------------------------------

  -----------------packet getting report-----------------
  file:  flash:/capture.cap                                                    
  packets getting: interface GigabitEthernet1/0/1
  acl: -                                                                        
  vlan: -  cvlan: -                                                             
  car: 64kbps timeout: 60s                                                      
  packets: 100 (expected) 2 (actual)                                            
  length: 64 (expected)                                                        
  ------------------------------------------------------- 
Table 16-83  Description of the capture-packet command output

Item

Description

Packet(inbound): i ith captured (incoming/outgoing) packet.
  • inbound: incoming packet
  • outbound: outgoing packet

file

Local path that stores captured packets. If NULL is displayed, captured packets are displayed to the terminal.

packets getting
  • Specific interface name: Packets on this interface are captured.
  • global: Packets matched a specified ACL or ACL6 are captured.

acl

ACL number matched by captured packets.

acl ipv6

ACL6 number matched by captured packets.

vlan

VLAN ID of captured packets.

cvlan

Inner VLAN ID of captured packets.

car

Rate of captured packets.

timeout

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

packets

  • expected: number of packets expected to be captured
  • actual: actual number of captured packets
  • inbound actual: actual number of captured incoming packets
  • outbound actual: actual number of captured outgoing packets

length

Length of captured packets.

capture-packet cpu

Function

The capture-packet cpu command captures packets sent to the CPU.

Format

capture-packet cpu [ vlan vlan-id | acl { ipv4-acl | ipv6 ipv6-acl } ] * destination { file file-name | terminal } * [ time-out time-out-value | packet-num number | packet-len length ] *

Parameters

Parameter

Description

Value

vlan vlan-id

Captures packets from a specified VLAN.

The value is an integer that ranges from 1 to 4094.

acl { ipv4-acl | ipv6 ipv6-acl }

Captures packets matching a specified ACL or ACL6.

NOTE:

The specified ACL or ACL6 must exist and contain ACL rules.

  • ipv4-acl: The value is an integer that ranges from 2000 to 5999.
  • ipv6 ipv6-acl: The value is an integer that ranges from 2000 to 3999.

destination

Indicates the destination to which captured packet information is sent.

-

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.

terminal

Displays captured packet information on a terminal.

-

time-out time-out-value

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.

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

When a CPU fault occurs, such as the CPU usage is high, configure the packet capture function to capture packets sent to the CPU for analysis. This allows the device to process invalid packets in time, ensuring that the CPU works properly.

Precautions

  • If the IP addresses of ARP packets on the control plane match the IP addresses in a basic or advanced ACL, these ARP packets can also be captured.
  • Running this command will increase the CPU usage. Therefore, you are not advised to run this command if the CPU usage is higher than the specified value in a Warning message.
  • The packet capture configuration is not saved in the configuration file, and becomes invalid when packet capture is complete.
  • Different packet capture instances cannot be executed simultaneously. That is, a new packet capture instance can be executed only when the previous one is complete.
  • The system limits the rate of captured packets. The default rate limit is 64 kbit/s. If the rate of packets exceeds the limit, some packets may be discarded.
  • If an interface on the X series cards is added to an Eth-trunk, the interface does not support packet capturing.

Example

# Capture the packets to be sent to the CPU, saves them to the abc.cap file, and display them on the terminal.
<HUAWEI> system-view
[HUAWEI] capture-packet cpu destination file flash:/abc.cap
[HUAWEI]                                                    
  Packet: 1                                                                     
  -------------------------------------------------------                       
  01 80 c2 00 00 0e 00 e0 09 87 78 90 81 00 00 01                               
  88 cc 02 07 04 00 e0 09 87 78 90 04 16 05 47 69                               
  67 61 62 69 74 45 74 68 65 72 6e 65 74 34 2f 30                               
  2f 32 36 06 02 00 78 08 15 47 69 67 61 62 69 74                               
  -------------------------------------------------------                       
                                                                                
  Packet: 2                                                                     
  -------------------------------------------------------                       
  01 80 c2 00 00 0e 00 e0 09 87 78 90 81 00 00 01                               
  88 cc 02 07 04 00 e0 09 87 78 90 04 16 05 47 69                               
  67 61 62 69 74 45 74 68 65 72 6e 65 74 34 2f 30                               
  2f 32 36 06 02 00 78 08 15 47 69 67 61 62 69 74                               
  -------------------------------------------------------                       
                                                                                
  ------------------packet getting report-----------------------                
  file: flash:/abc.cap                                                         
  packets getting: cpu                                                          
  acl: -                                                                        
  vlan: -  cvlan: -                                                             
  car: -- timeout: 60s                                                          
  packets: 100 (expected) 2 (actual)                                            
  length: 64 (expected)                                                         
  -------------------------------------------------------  
Table 16-84  Description of the capture-packet cpu command output

Item

Description

Packet: i ith captured packet.

file

Local path that stores captured packets. If NULL is displayed, captured packets are displayed to the terminal.

packets getting

The system captures the packets to be sent to the CPU.

acl

ACL number matched by captured packets.

acl ipv6

ACL6 number matched by captured packets.

vlan

VLAN ID of captured packets.

cvlan

Inner VLAN ID of captured packets.

car

Rate of captured packets.

timeout

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

packets

  • expected: number of packets expected to be captured
  • actual: actual number of captured packets

length

Length of captured packets.

Translation
Download
Updated: 2019-04-09

Document ID: EDOC1100065659

Views: 127261

Downloads: 88

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