Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

request packet-capture start

Syntax

Description

Captures packet information from the operational mode. You can execute the packet capture from the operational mode with minimal impact to the production system without committing the configurations. You can define the packet filter to trace the type of traffic based on your requirement.

You can request for only one packet capture at a time, and you need to stop each packet capture request before you give an another packet capture request. For each packet capture request, you need to give the respective show command to view the output.

In chassis cluster mode, you must request operational mode packet capture from the primary node. Operational mode packet capture does not function when executed from the secondary node.

Options

bidirectional

Allows to collect bidirectional information.

capture-file

Name of the capture file. It generates a pcap file, which can support Wireshark by adding the suffix ‘.pcap’.

count

Number of packets to capture.

  • Range: 10 through 1000000

  • Default: 100

destination-port

TCP/UDP destination port.

destination-prefix

Destination IPv4/IPv6 address prefix to filter the packets.

interface

Name of the logical interface.

maximum-capture-size

The maximum size of packet capture. The packet truncates if the capture size is more than the specified capture size.

  • Range: 68 through 10000

  • Default: 1514

protocol-number

Numeric protocol value.

  • Range: 0 through 255

  • Default: 0

size

The maximum size of packet capture file.

  • Range: 10240 through 1073741824

  • Default: 50M

source-port

TCP/UDP source port.

source-prefix

Source IPv4/IPv6 address prefix to filter the packets.

Required Privilege Level

view

Output Fields

Table 1 lists the output fields for the request packet-capture start command. Output fields are listed in the approximate order in which they appear.

Table 1: request packet-capture start Output Fields

Field Name

Field Description

packet capture is running

Status of the packet capture session:

  • 0: No packet capture is performing.

  • 1: Packet capture is performing.

counter of packet capture

Number of packets captured.

packet capture capture-file name

Name, location, size and capture length of the packet capture file.

Flag

Decimal value corresponding to the type of filter configured. Convert this value to binary or hexadecimal format such as:

  • 0x000 (No filters)

  • 0x001 (Source IP)

  • 0x002 (Destination IP)

  • 0x004 (Protocol)

  • 0x008 (Source port)

  • 0x010 (Destination port)

  • 0x040 (Filter is valid)

  • 0x200 (IPv6 Source IP)

  • 0x400 (IPv6 Destination IP)

  • 0x800 (Interface)

For example if the flag value is 72, convert it to binary or hexadecimal format:

72 = 0x48

  • 0x040 (Filter is valid)

  • 0x008 (Source port)

This means that the filter is valid and only configured with the filter source port.

Source

Source IPv4/IPv6 address.

Destination

Destination IPv4/IPv6 address.

Interface

Name of the logical interface.

bidirectional

Status of the bidirectional keyword configuration:

  • 0: Not configured.

  • 1: Configured.

Protocol

Numeric protocol value.

rotate

Number of capture files.

snap_len

The maximum packet capture size.

ifl

If index value of interface.

Sample Output

Packet capture using protocol, destination port, destination prefix, and bidirectional options

Packet capture using interface

Packet capture using source prefix

Packet capture using source port

Packet capture using protocol

Release Information

Statement introduced in Junos OS Release 19.3R1.