Supported Platforms
Example: Configuring Packet Capture on an Interface
This example shows how to configure packet capture on an interface to analyze traffic.
Requirements
Before you begin:
- Establish basic connectivity. See the Getting Started Guide for your device.
- Configure network interfaces. See Junos OS Interfaces Library for Security Devices.
Overview
In this example, you create an interface called fe-0/0/1. You then configure the direction of the traffic for which you are enabling packet capture on the logical interface as inbound and outbound.
![]() | Note: On traffic that bypasses the flow software module (protocol packets such as ARP, OSPF, and PIM), packets generated by the Routing Engine are not captured unless you have configured and applied a firewall filter on the interface in the output direction. |
Configuration
CLI Quick Configuration
To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode.
To configure packet capture on an interface:
- Create an interface.[edit]user@host# edit interfaces fe-0/0/1
- Configure the direction of the traffic.[edit interfaces fe-0/0/1]user@host# set unit 0 family inet sampling input output
- If you are done configuring the device, commit the configuration.[edit]user@host# commit
Verification
Verifying the Packet Capture Configuration
Purpose
Confirm that the configuration is working properly.
Verify that packet capture is configured on the interface.
Action
From configuration mode, enter the show interfaces fe-0/0/1 command.