Docs / Networking / How to Use tcpdump for Network Troubleshooting

How to Use tcpdump for Network Troubleshooting

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 412 views · 1 min read

tcpdump captures and analyzes network packets for debugging connectivity issues.

Install

apt install tcpdump -y

Capture All Traffic

tcpdump -i eth0

Filter by Port

tcpdump -i eth0 port 80\ntcpdump -i eth0 port 22

Filter by Host

tcpdump -i eth0 host 203.0.113.50

Save to File

tcpdump -i eth0 -w capture.pcap

Read Capture File

tcpdump -r capture.pcap

Useful Filters

# HTTP requests only\ntcpdump -i eth0 'tcp port 80 and tcp[32:4] = 0x47455420'\n\n# DNS queries\ntcpdump -i eth0 port 53\n\n# Show packet contents\ntcpdump -i eth0 -X port 80

Was this article helpful?