Install Tcpdump On A Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS

Install Tcpdump On A Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS

tcpdump

Dump traffic on a network.

Maintainer: Romain Francoise



Section: net

Install tcpdump

  • Debian apt-get install tcpdump Click to copy
  • Ubuntu apt-get install tcpdump Click to copy
  • Alpine OS apk add tcpdump Click to copy
  • Arch Linux pacman -S tcpdump Click to copy
  • Kali Linux apt-get install tcpdump Click to copy
  • CentOS yum install tcpdump Click to copy
  • Fedora dnf install tcpdump Click to copy
  • Raspbian apt-get install tcpdump Click to copy
  • macOS brew install tcpdump Click to copy

Dump traffic on a network.

How to use tcpdump?

Below are few example commands for tcpdump that you can use in the terminal.

List available network interfaces:
tcpdump -DClick to copy
Capture the traffic of a specific interface:
tcpdump -i eth0Click to copy
Capture all TCP traffic showing contents (ASCII) in console:
tcpdump -A tcpClick to copy
Capture the traffic from or to a host:
tcpdump host www.example.comClick to copy
Capture the traffic from a specific interface, source, destination and destination port:
tcpdump -i eth0 src 192.168.1.1 and dst 192.168.1.2 and dst port 80Click to copy
Capture the traffic of a network:
tcpdump net 192.168.1.0/24Click to copy
Capture all traffic except traffic over port 22 and save to a dump file:
tcpdump -w dumpfile.pcap not port 22Click to copy
Read from a given dump file:
tcpdump -r dumpfile.pcapClick to copy
Installing tcpdump command is simple. just copy one of the above commands for your operating system and paste it into terminal. This command is available for Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian and macOS operating systems. Once you run the command it will install the latest version of tcpdump 2026 package in your OS.