315
Task
Command
Capture incoming packets
on an interface.
•
Save captured packets to a file:
packet-capture interface
interface-type
interface-number
[
capture-filter
capt-expression
|
limit-captured-frames
limit
|
limit-frame-size
bytes
|
autostop filesize
kilobytes
|
autostop
duration
seconds
|
autostop files numbers
|
capture-ring-buffer
filesize
kilobytes
|
capture-ring-buffer duration
seconds
|
capture-ring-buffer files
numbers
] *
write
filepath
[
raw
| {
brief
|
verbose
} ] *
•
Filter packets to display:
packet-capture interface
interface-type
interface-number
[
capture-filter
capt-expression
|
display-filter
disp-expression
|
limit-captured-frames
limit
|
limit-frame-size
bytes
|
autostop
duration
seconds
] * [
raw
| {
brief
|
verbose
} ] *
Displaying the contents in a packet file
Task
Command
Remarks
Display the contents in a
packet file.
packet-capture read filepath
[
verbose
]
[
display-filter
disp-expression
] [
raw
| {
brief
|
verbose
} ] *
A packet file must use
the .pcap or .pcapng
extension.
Displaying and maintaining packet capture
Execute
display
commands in any view.
Task
Command
Display the packet capture status.
display packet-capture status
Packet capture configuration examples
Remote packet capture configuration example
Network requirements
As shown in
, capture packets on GigabitEthernet 1/0/1 and use Wireshark to display the
captured packets.