Capture CPU packet commands
Use these M4500 CLI commands to capture CPU packets to RAM, a file, or a remote host, set capture options, and display captured packets.
show capture
Use this command to display packets captured and save to RAM, It is possible to capture and save into RAM, packets that are received or transmitted throuph the CPU. A maximum 128 packets can be saved into RAM per capturing session. A maximum 128 bytes per packet can be saved into the RAM. If a packet holds more than 128 bytes, only the first 128 bytes are saved; data more than 128 bytes is skipped and cannot be displayed in the CLI.
Capturing packets is stopped automatically when 128 packets are captured and have not yet been displayed during a capture session. Captured packets are not retained after a reload cycle.
| Default | None |
| Format | show capture [packets] |
| Mode | Privileged Exec |
Display Message
| Parameter | Definition |
|---|---|
| <packets> | Specifies this parameter to display the captured packets on the CLI. |
| Operational Status | Displays capture status. |
| Current Capturing Type | Displays the current capturing type. Possible types are Line, File, and Remote. |
| Capturing Traffic Mode | Displays the capturing traffic mode. Possible modes are Rx, Tx, or Tx/Rx. |
| Line Wrap Mode | Displays the line wrap mode for Line capturing type. Default is disabled. |
| RPCAP Listening Port | Displays the pcap listening port number. Default listening port number is 2002. |
| RPCAP dump file size (KB) | Disaply the capture packet file size. Default file size is 512KB. |
capture start
Use this command to manually start capturing CPU packets for packet trace. The packet capture operates in three modes:
- capture file
- remote capture
- capture line
This command is not persistent across a reboot cycle.
| Default | None |
| Format | capture start [{all | received | transmit}] |
| Mode | Privileged Exec |
| Parameter | Definition |
|---|---|
| all | Specifies all to capture packets for both transmitted and received packets. |
| received | Specifies received to capture only received packets. |
| transmit | Specifies transmit to capture only transmitted packets. |
capture stop
Use this command to manually stop capturing CPU packets for packets for trace.
| Default | None |
| Format | capture stop |
| Mode | Privileged Exec |
capture {file | remote | line}
Use this command to configure packet capture options. This command is persistent across a reboot cycle.
| Default | Remote |
| Format | capture {file | remote | line} |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| file | In the capture file mode, the captured packets are stored in a file. The maximum file size defaults to 512KB. The switch can transfer the file to a TFTP server via TFTP, FTP via CLI. The file is formatted in pcap format, is name cpu-pkt-capture.pcap, and can be examined using network analyzer tools such as Wireshark or Ethereal. Starting a file capture automatically terminates any remote capture sessions and line captureing. After the packet capture is activated, the capture proceeds until the capture file reaches its maximum size, or until the capture is stopped manually using CLI command capture stop. |
| Remote | In the remote capture mode, the captured packets are redirected in real time to an external PC running the wireshark tool for Microsoft Windows. A packet capture server runs on the switch side and sends the captured packets via a TCP connection to the Wireshark tool. The remote capture can be enabled or disable using the CLI. There should be a Windows PC with the Wireshark tool to display the captured file. When using the remote capture mode, the switch does not sotre any captured data locally on its file system. |
| line | In the capture line mode, the captured packets are saved into the RAM and can be displayed on the CLI. Starting a line capture automatically terminates any remote capture session and capturing into a file. There is a maximum 128 packets of maximum 128 btes that can be captured and displayed in Line mode. |
capture remote port
Use this command to configure file capture options. This command is persistent across a reboot cycle.
| Default | 2002 |
| Format | capture remote [port <port-id>] |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| <port-id> | Configure the listening TCP port. The range of port ID is 1024 to 49151. |
capture file size
Use this command to configure file capture options. This command is persistent across a reboot cycle.
| Default | 512 |
| Format | capture file [size <file-size>] |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| <file-size> | Configure the file size in KB. The range of file size is 2 to 512KB. |
capture line wrap
This command enables wrapping of captured packets in line mode when the captured packets reaches full capacity. This command is persistent across a reboot cycle.
| Default | Disable |
| Format | capture line [wrap] |
| Mode | Global Config |
no capture line wrap
This command disables wrapping of captured packets and configures capture packet to stop when the captured packet capacity is full.
| Format | no capture line wrap |
| Mode | Global Config |