NetEngine AR600, AR6100, AR6200, and AR6300 V300R019 Command Reference
Packet Capture Configuration Command
Support for Packet Capture
Hardware Requirements
This section is applicable to all models. For details about differences for specific models, see the description in the corresponding section.
capture-packet
Function
The capture-packet command captures service packets matching specified rules, and displays captured packet information on the terminal or saves the captured packets on the local device.
By default, the packet capture function is not configured on a device.
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.
|
- |
acl |
Configures an ACL. NOTE:
A maximum of 16 rules can be configured for an ACL. |
- |
acl-number |
Captures packets matching a specified ACL. |
The value is an integer that ranges from 2000 to 4999. |
destination |
Specifies 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. file-name is in the format of [drive][file-name] (such as flash:/test.cap), in which [file-name] is in the format of *.cap. |
The value is a string of 5 to 63 characters without spaces. When quotation marks are used around the string, spaces are allowed in the string. |
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. |
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
When packets are received by a LAN port and sent to a LAN port, the packets cannot be captured.
When the 8FE1GE or 24GE card is installed on a device and the inbound interface is on the 8FE1GE or 24GE card, both Layer 2 and Layer 3 packets are forwarded by LSW, and the packets cannot be mirrored. When the inbound interface is on another LAN card, Layer 2 packets cannot be mirrored and Layer 3 packets can be mirrored.
The device can capture incoming and 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 GE1/0/0 and display packet information on the terminal.
<Huawei> system-view [Huawei] capture-packet interface gigabitethernet 1/0/0 destination terminal time-out 10 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: GigabitEthernet1/0/0 acl: - car: 64pps timeout: 10s packets: 100 (expected) 1 (actual) length: 128 (expected) -------------------------------------------------------
Item |
Description |
---|---|
file |
Local path that stores captured packets. NULL marking for empty. |
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. |
display voice-monitor
Function
The display voice-monitor command displays information about voice packets passing the device.
The display voice-monitor command can be configured but does not take effect.
Usage Guidelines
Usage Scenario
To view information about voice packets passing the device, run the display voice-monitor command.
Prerequisites
The device is configured to capture voice packets using the voice-monitor command.
Example
# Display information about voice packets passing the device.
<Huawei> display voice-monitor
---------------------------------------------------------------------------
TelNo IPAddr Port Direction RuleIndex
---------------------------------------------------------------------------
20000 10.0.0.1 51201 Inbound 0
10000 10.0.0.2 61945 Outbound 1
Item |
Description |
---|---|
TelNo |
Phone number in the captured voice packets. |
IPAddr |
IP address of voice packets. |
Port |
Port number of voice packets. |
Direction |
Direction of voice packets:
|
RuleIndex |
ID of the resource occupied by voice packets. |
voice-monitor
Function
The voice-monitor command configures the device to capture voice packets passing the device and save them.
By default, the device is not configured to capture voice packets passing the device.
The voice-monitor command can be configured but does not take effect.
Format
voice-monitor interface interface-type interface-number destination file file-name * telno telephone-number &<1-8> [ car cir cir-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.
|
- |
destination |
Specifies the destination where captured packets are saved. |
- |
file file-name |
Specifies the name of the file for storing captured packets. |
The value is a string of 5 to 63 characters without spaces. The value must end with *.cap. The file name format is [drive]:/[file-name], for example, flash:/filename.cap. [drive] indicates the storage path on the device. The value can be either of the following:
|
telno telephone-number &<1-8> |
Specifies the phone number in captured packets. |
The value is a string of 1 to 24 numerals. Each numeral ranges from 0 to 9. A maximum of 8 telephone numbers can be entered. |
car cir cir-value |
Specifies the rate at which packets are captured. |
The value is an integer that ranges from 1 to 256, in pps. The default rate is 64 pps. |
time-out time |
Specifies the timeout interval of packet capture. The system stops capturing packets after the specified timeout interval. |
The value is an integer that ranges from 1 to 300, in seconds. The default timeout interval 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. |
Usage Guidelines
Usage Scenario
When unexpected voice traffic occurs, for example, the traffic status does not match the traffic model, run the voice-monitor command to configure the device to capture voice packets for analysis. Then the device can process invalid packets in a timely manner, and data services can be correctly transmitted and voice communication quality is ensured.
When configuring packet capture, you can set parameters according to the number of packets on an interface. If there are many packets on the interface, set a small value of time and a large value of number. If there are fewer packets on an interface, set a large value of time and a small value of number.
Precautions
The packet capture configuration is not saved in the configuration file, and becomes invalid when packet capture is complete.
Before using the voice-monitor 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 interval of packet capture and number of packets to be captured. The system stops capturing packets after the timeout interval or the number of packets to be captured is reached.
The voice-monitor and capture-packet commands cannot be configured simultaneously.
Example
# Configure the device to capture voice packets on GE1/0/0 and save them in the capture.cap file.
<Huawei> system-view [Huawei] voice-monitor interface gigabitethernet 1/0/0 destination file flash:/capture.cap telno 10000 20000 Warning: The packet capture function has been enabled and packets are stored in flash:/capture.cap . [Huawei] ------------------capture report----------------------- file: flash:/capture.cap interface: GigabitEthernet1/0/0 acl: - car: 64pps timeout: 60s packets: 100 (expected) 0 (actual) length: 64 (expected) -------------------------------------------------------
Item |
Description |
---|---|
file |
File name and path for storing captured packets. |
interface |
Interface where packets are captured. |
acl |
ACL number. |
car |
Rate at which packets are captured. |
timeout |
Timeout interval of packet capture. The system stops capturing packets after the specified timeout interval. |
packets |
Expected and actual numbers of captured packets. |
length |
Length of captured packets. |