netsniff-ng -i eth0Captures packets from the eth0 interface and prints basic header information to the console.
A high-performance Linux networking toolkit using zero-copy packet mmap: capture, replay, traffic generation and analysis.
sudo apt install netsniff-ngnetsniff-ng -i eth0 -XCaptures packets and displays the payload in both hexadecimal and ASCII format for deep inspection.
netsniff-ng -i eth0 -lDisplays one line of summary information per packet, useful for high-volume traffic monitoring.
netsniff-ng -i eth0 -VEnables verbose mode to show detailed internal status and packet processing information.
netsniff-ng -i eth0 -pExplicitly disables promiscuous mode, capturing only packets destined for the interface's MAC address.
netsniff-ng -i eth0 -o dump.pcapCaptures packets from eth0 and writes them directly to a PCAP file using zero-copy mechanisms.
Example
netsniff-ng -i eth0 -o capture.pcapnetsniff-ng -i eth0 -o /mnt/data/dump.pcap -sWrites packets to a file silently without console output, ideal for high-speed background recording.
netsniff-ng -i dump.pcapReads a previously saved PCAP file and displays the packet contents to the standard output.
Example
netsniff-ng -i capture.pcapnetsniff-ng -i dump.pcap -o eth0Replays packets from a PCAP file out through the eth0 network interface onto the live network.
Example
netsniff-ng -i traffic.pcap -o eth0netsniff-ng -i dump.pcap -o eth0 -sReplays traffic silently to the network interface to achieve maximum throughput generation.
Example
netsniff-ng -i traffic.pcap -o eth0 -snetsniff-ng -i dump.pcap -o eth0 -I 100Replays packets with a fixed inter-packet interval of 100 microseconds, ignoring original timestamps.
netsniff-ng -i eth0 -n 1000Captures exactly 1000 packets and then automatically exits.
netsniff-ng -i eth0 -T 10sCaptures traffic for exactly 10 seconds and then terminates the process.
netsniff-ng -i eth0 -b 0Pins the packet capture process to CPU core 0 to reduce cache misses and improve capture performance.
netsniff-ng -i eth0 -b 1 -s -o dump.pcapCombines CPU pinning to core 1, silent mode, and file writing for an optimized capture pipeline.
netsniff-ng -i eth0 -HRuns the process with high priority (SCHED_FIFO) to minimize latency and packet loss on loaded systems.
netsniff-ng -i eth0 --hwtstamp-unsyncEnables hardware timestamping if the NIC supports it, without synchronizing to the system clock.
netsniff-ng -i eth0 -f filter.bpfApplies a pre-compiled Berkeley Packet Filter (BPF) code from a file to filter traffic at the kernel level.
Example
netsniff-ng -i eth0 -f http_filter.bpfnetsniff-ng -i eth0 -f /etc/netsniff-ng/rules.bpf -o filtered.pcapCaptures only packets matching the BPF rules defined in the file and writes them to disk.
Example
netsniff-ng -i eth0 -f rules.bpf -o filtered.pcapnetsniff-ng -i eth0 --scatter-gatherEnables scatter-gather I/O on the packet socket, which may improve performance on specific hardware configurations.
netsniff-ng -i eth0 --mmapExplicitly forces memory-mapped packet socket mode (standard in netsniff-ng) for zero-copy efficiency.
netsniff-ng -i eth0 -o /var/log/pcap/ -P dump -n 10000Writes to a directory with a file prefix, rotating the file after every 10,000 packets.
netsniff-ng -i eth0 -o . -P trace -F 100MiBRotates capture files in the current directory with prefix 'trace' whenever a file reaches 100 MiB.
netsniff-ng -i eth0 -u 1000 -g 1000Drops root privileges to the specified user and group ID after initializing the capture socket for security.
netsniff-ng -i eth0 -JEnables support for jumbo frames in the ring buffer layout to accommodate packets larger than standard MTU.
netsniff-ng -i eth0 --randRandomizes the MAC address of the interface before starting operations (if supported by driver).
netsniff-ng -i wlan0 --rfrawEnables raw radio frequency monitor mode on wireless interfaces for capturing 802.11 management frames.
netsniff-ng -i eth0 -o vlan.pcap --verboseCaptures traffic including VLAN tags and prints detailed protocol structures for verification.
netsniff-ng -i eth0 --trafgenUsually redirects to the trafgen tool, but netsniff-ng handles replay; this mode relates to TX path optimization.
netsniff-ng -i eth0 --statsPrints kernel-level packet socket statistics including drop counts and freeze status upon exit.
netsniff-ng -i eth0 -kLocks the process memory into RAM (mlockall) to prevent swapping and ensure consistent high-speed capture.
netsniff-ng -i lo -o loopback.pcapCaptures internal local traffic on the loopback interface and saves it to a file.
netsniff-ng -i eth0 --pipeWrites raw packet data to stdout for piping into other tools without pcap headers.
netsniff-ng -i malicious.pcap -o eth0 -k -s -b 0Replays malicious traffic for IDS testing with memory locking, CPU pinning, and silent mode for precision.
netsniff-ng -i eth0 -G 5sRotates the capture file every 5 seconds, useful for segmenting continuous monitoring data.
netsniff-ng -i eth0 --hexDumps the packet content in a hex format, an alias for the -X option.
netsniff-ng -vDisplays the version information and build features of the installed netsniff-ng tool.
netsniff-ng --helpDisplays the complete help documentation with all available command-line options.
netsniff-ng -i eth0 -s -o /var/log/traffic/ -P daily -S 512MiB -k -b 0A production-grade monitoring command with silent capture, large ring buffer, memory locking, CPU affinity, and file rotation.
The classic packet capture tool: capture and filter traffic with BPF expressions and write it to pcap files for later analysis.
Replays captured pcap traffic onto a network at chosen speeds — useful for testing IDS rules and network devices.
Wireshark’s terminal version: capture and decode traffic with full dissectors and display filters, and extract fields to text.
The utilities that ship with Wireshark — editcap, mergecap, capinfos, dumpcap and text2pcap — for working with capture files.
“Network grep” — matches regular expressions against packet payloads, like grep for network traffic.