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 ] *
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. The destination IPv6 address should not be specified in rules of the ACL6 for the S2720-EI, S5720I-SI, S5720-LI, S5735-L, S5735S-L, S5735S-L-M, S5720S-LI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730S-EI, S5730-SI, S6720-LI, S6720S-LI, S6720S-SI, or S6720-SI. Otherwise, packets will fail to be captured. |
|
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 packet capture. The system stops capturing packets after the specified timeout period elapses. |
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. |
Usage Scenario
When a CPU fault occurs (for example, the CPU usage is high), configure the packet capture function to capture packets sent to the CPU for analysis. This allows the switch to process invalid packets promptly, ensuring that the CPU works properly.
Precautions
<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 without tunnel header: 64 (expected) -------------------------------------------------------
Item |
Description |
---|---|
Packet: i |
ith captured packet. |
file |
Local path that stores captured packets. If NULL is displayed, captured packets are displayed on a terminal, instead of being saved to a specified file. |
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 period of packet capture. The system stops capturing packets after the specified timeout period elapses. |
packets |
|
length without tunnel header |
Length of captured packets, excluding the length of tunnel headers. |