tcpdump – CLI Packet Capture, BPF Filters & Output Decoding
1. What Is tcpdump?
tcpdump is a command-line packet analyser for Unix/Linux/macOS
systems that captures and inspects network traffic in real time. It uses the
libpcap library to read packets directly from a network interface and
applies BPF (Berkeley Packet Filter) expressions to select only the
traffic you care about.
It is the standard tool for on-the-wire packet capture when a GUI tool like
Wireshark is unavailable — on servers, network appliances, and embedded Linux
systems. Captures can be saved to .pcap files and opened in
Wireshark for graphical analysis later.
| Use Case | What tcpdump Reveals |
|---|---|
| Connectivity troubleshooting | Is traffic actually leaving/arriving on the interface? Are ARP requests being answered? Is the TCP handshake completing? |
| Protocol verification | Confirm DHCP DORA, DNS query/response, OSPF Hello packets, BGP keepalives are present and correct |
| Security analysis | Detect port scans, ARP spoofing, unexpected outbound connections, cleartext credentials in HTTP/FTP/Telnet |
| Performance diagnosis | Identify TCP retransmissions, duplicate ACKs, window size issues, high RTT — symptoms of network congestion |
| Configuration validation | Verify ACL allow/deny behaviour, NAT translation, routing decisions by watching actual packet flow |
Related pages: How DNS Works | DNS Record Types | DHCP How It Works | Common Port Numbers | show ip route | Troubleshooting Methodology | End-to-End Troubleshooting Lab
2. Installation and Interface Discovery
# ── Check if tcpdump is installed ───────────────────────────────────────── which tcpdump # Shows path if installed: /usr/sbin/tcpdump tcpdump --version # Shows version and libpcap version # ── Install tcpdump ──────────────────────────────────────────────────────── # Debian / Ubuntu: sudo apt install tcpdump # RHEL / CentOS / Fedora: sudo yum install tcpdump # or: sudo dnf install tcpdump # macOS (comes pre-installed; or via Homebrew): brew install tcpdump # ── List available interfaces ────────────────────────────────────────────── sudo tcpdump -D # or: tcpdump --list-interfaces # Sample output: # 1.eth0 [Up, Running, Connected] # 2.lo [Up, Running, Loopback] # 3.wlan0 [Up, Running, Wireless] # 4.any (Pseudo-device that captures on all interfaces) # ── Capture on ALL interfaces simultaneously ─────────────────────────────── sudo tcpdump -i any # ── Capture on specific interface ────────────────────────────────────────── sudo tcpdump -i eth0 sudo tcpdump -i ens3 # Common on newer Ubuntu/RHEL naming sudo tcpdump -i enp0s3 # VirtualBox default NIC naming
sudo setcap cap_net_raw,cap_net_admin+eip $(which tcpdump)
— then run without sudo. On macOS, members of the access_bpf
group can capture without sudo.
3. BPF Filter Syntax — Complete Reference
BPF (Berkeley Packet Filter) expressions are evaluated in kernel space for maximum efficiency — packets that don't match are discarded before being passed to userspace, minimising CPU and memory impact.
Primitives — the building blocks
| Primitive | Example | What It Matches |
|---|---|---|
host |
host 192.168.1.5 |
Any packet where src OR dst IP = 192.168.1.5 |
src host |
src host 10.0.0.1 |
Packets sourced FROM 10.0.0.1 only |
dst host |
dst host 10.0.0.2 |
Packets destined TO 10.0.0.2 only |
net |
net 192.168.0.0/24 |
Any packet where src OR dst is in the subnet |
src net |
src net 10.0.0.0/8 |
Traffic originating from within the 10.x.x.x range |
port |
port 443 |
Any packet where src OR dst port = 443 |
src port |
src port 1234 |
Packets with source port 1234 (client ephemeral port) |
dst port |
dst port 80 |
Packets destined to port 80 (inbound HTTP requests) |
portrange |
portrange 8000-8080 |
Any packet with port in the range 8000–8080 |
tcp |
tcp |
All TCP packets |
udp |
udp |
All UDP packets |
icmp |
icmp |
All ICMP packets (ping, unreachable, redirect, etc.) |
arp |
arp |
All ARP packets (request and reply) |
ether host |
ether host aa:bb:cc:dd:ee:ff |
Packets with specific source or destination MAC address |
broadcast |
ether broadcast |
Ethernet broadcast frames (FF:FF:FF:FF:FF:FF) |
vlan |
vlan 10 |
802.1Q tagged frames for VLAN 10 (on trunk-capable interfaces) |
Boolean Operators
# and / && -- both conditions must be true: sudo tcpdump 'tcp and port 22 and host 10.0.0.5' # Matches: TCP traffic on port 22 involving 10.0.0.5 # or / || -- either condition must be true: sudo tcpdump 'port 80 or port 443' # Matches: HTTP or HTTPS traffic # not / ! -- negate a condition: sudo tcpdump 'not arp' # Matches: everything except ARP # Grouping with parentheses (requires quotes on shell): sudo tcpdump '(src net 192.168.1.0/24 or src net 10.0.0.0/8) and dst port 443' # Matches: HTTPS traffic from either internal subnet # src and dst (both directions between two specific hosts): sudo tcpdump 'src host 10.0.0.1 and dst host 10.0.0.2' # Note: 'host A and host B' catches A-to-B AND B-to-A # 'src host A and dst host B' catches ONLY A-to-B direction
Common Protocol Filter Examples
| Goal | Filter Expression |
|---|---|
| All DNS traffic | port 53 |
| DNS queries only (UDP, outbound to server) | udp and dst port 53 |
| DHCP discovery/request | udp and (port 67 or port 68) |
| All SSH traffic | tcp and port 22 |
| HTTPS only | tcp and port 443 |
| All traffic to/from a host except SSH | host 10.0.0.5 and not port 22 |
| ICMP ping to a specific host | icmp and host 8.8.8.8 |
| Traffic from subnet, not to port 22 | src net 192.168.1.0/24 and not dst port 22 |
| OSPF protocol packets | proto ospf |
| BGP (TCP port 179) | tcp and port 179 |
4. Essential Command-Line Options
| Option | Function | Example | Notes |
|---|---|---|---|
-i |
Select capture interface | -i eth0 |
Use -i any to capture all interfaces |
-w |
Write packets to .pcap file | -w capture.pcap |
No output to terminal while writing; use Ctrl+C to stop |
-r |
Read packets from .pcap file | -r capture.pcap |
Applies filters when reading; no root required for -r |
-c |
Capture N packets then stop | -c 100 |
Avoids runaway captures; combine with filters |
-n |
Disable DNS resolution (show IPs, not hostnames) | -n |
Speeds output; avoids misleading reverse-DNS results |
-nn |
Disable DNS AND port name resolution | -nn |
Shows port numbers (80) instead of names (http) |
-v |
Verbose — show TTL, ToS, checksum | -v |
One level; use -vv or -vvv for more detail |
-vv |
Very verbose — show protocol options | -vv |
Adds TCP options (MSS, timestamp, SACK), DHCP options |
-vvv |
Maximum verbosity | -vvv |
Full protocol field decoding |
-X |
Show packet payload in hex + ASCII | -X |
Use to see cleartext credentials, HTTP headers, DNS names |
-XX |
Show hex+ASCII including Ethernet header | -XX |
Adds Layer 2 header to -X output |
-A |
Show packet payload in ASCII only | -A |
Cleaner for reading HTTP headers and plaintext protocols |
-e |
Print MAC addresses (Layer 2 headers) | -e |
Useful for ARP/VLAN troubleshooting |
-s |
Set snap length (bytes per packet to capture) | -s 0 |
-s 0 = capture full packet. Default 96B misses payloads |
-S |
Print absolute TCP sequence numbers | -S |
Default shows relative numbers; -S shows raw values |
-p |
Disable promiscuous mode | -p |
Default: promiscuous (captures all frames, not just host's). -p restricts to traffic destined for this host |
-D |
List available interfaces | -D |
Identify interface names before capturing |
-C |
File rotation by size (MB) | -C 10 |
Creates new file every 10 MB: file0, file1, file2... |
-G |
File rotation by time (seconds) | -G 60 |
Creates new file every 60 seconds; combine with -w timestamp |
-W |
Limit number of rotation files | -W 10 |
Keeps only last 10 files (circular buffer) |
5. Decoding tcpdump Output Line by Line
# Standard output line:
14:23:05.123456 IP 192.168.1.100.54321 > 8.8.8.8.53: UDP, length 29
^ ^ ^ ^ ^ ^ ^
Timestamp IP Src_IP.SrcPort Dst_IP.DstPort Proto Payload_length
# TCP output (more fields):
14:23:10.456789 IP 192.168.1.100.54890 > 93.184.216.34.80: Flags [S], seq 3456789012, win 65535, length 0
^ ^ ^ ^
TCP flags Sequence number Window Data length
# Complete annotated example:
14:23:10.456789 IP 192.168.1.100.54890 > 93.184.216.34.80: Flags [S], seq 3456789012, win 65535, options [mss 1460], length 0
^^ ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IP = IPv4 packet Flags: Remaining TCP header fields
(IP6 for IPv6) [S]=SYN
[F]=FIN
[P]=PSH
[R]=RST
[.]=ACK
[S.]=SYN+ACK
TCP Flag Reference
| Flag Code in Output | TCP Flag | Meaning | Seen In |
|---|---|---|---|
[S] |
SYN | Initiates a TCP connection | First packet of 3-way handshake |
[S.] |
SYN-ACK | Server accepts connection | Second packet of handshake |
[.] |
ACK | Acknowledgement of received data | Third packet of handshake; every data ACK |
[P.] |
PSH-ACK | Push data to application immediately | Most data segments after handshake |
[F.] |
FIN-ACK | Graceful connection close | TCP teardown (4-way) |
[R] |
RST | Abrupt reset/reject connection | Port closed; connection refused; firewall drop |
[R.] |
RST-ACK | Reset with acknowledgement | Immediate connection rejection |
Reading the Hex+ASCII Output (-X flag)
# Command:
sudo tcpdump -nn -i eth0 -X -c 1 dst port 80
# Output with -X:
14:25:30.123456 IP 192.168.1.100.54321 > 93.184.216.34.80: Flags [P.], seq 1:78, length 77
0x0000: 4500 0074 3f3f 4000 4006 xxxx c0a8 0164 E..t??@[email protected]
0x0010: 5db8 d822 d431 0050 1234 5678 8765 4321 ]..".1.P.4Vx.eC!
0x0020: 8018 00e5 xxxx 0000 0101 080a xxxx xxxx ................
0x0030: 0000 0000 4745 5420 2f20 4854 5450 2f31 ....GET / HTTP/1
0x0040: 2e31 0d0a 486f 7374 3a20 6578 616d 706c .1..Host: exampl
0x0050: 652e 636f 6d0d 0a e.com..
# Left column: byte offset in hex
# Middle: raw hex bytes (each pair = 1 byte)
# Right column: ASCII representation (. = non-printable)
# You can read "GET / HTTP/1.1\r\nHost: example.com" in the ASCII column
6. Capture File Management
# ── Write to PCAP file ───────────────────────────────────────────────────── sudo tcpdump -i eth0 -w capture.pcap # Ctrl+C to stop. File is binary PCAP format -- not human readable. # ── Write with timestamp in filename ─────────────────────────────────────── sudo tcpdump -i eth0 -w capture-%Y%m%d-%H%M%S.pcap # ── Read a PCAP file ─────────────────────────────────────────────────────── tcpdump -r capture.pcap # No sudo required for reading; applies full filter syntax tcpdump -r capture.pcap 'tcp and port 443' # filter on read # ── Capture then apply different filters at read time ────────────────────── # First: capture everything (broad net) sudo tcpdump -i eth0 -s 0 -w full_capture.pcap # Later: extract only DNS from the full capture tcpdump -r full_capture.pcap 'port 53' # ── Large capture file rotation ──────────────────────────────────────────── # Rotate by size (10 MB per file): sudo tcpdump -i eth0 -w /tmp/cap-%H%M%S.pcap -C 10 # Rotate by time (60 seconds per file), keep last 10: sudo tcpdump -i eth0 -w /tmp/cap-%H%M%S.pcap -G 60 -W 10 # ── Pipe directly to Wireshark on a remote system ───────────────────────── # On the remote server (via SSH): ssh user@server 'sudo tcpdump -i eth0 -s 0 -w - "port 80"' | wireshark -k -i - # Wireshark opens on local machine, displaying live capture from remote server!
7. Filtering TCP Flags with BPF
You can filter on specific TCP flags using BPF bit-mask expressions. This is useful for isolating connection setup (SYN), resets (RST), and other specific events.
# BPF TCP flag syntax: # tcp[13] = the TCP flags byte (byte 13 of the TCP header, zero-indexed) # Flag bits: FIN=1, SYN=2, RST=4, PSH=8, ACK=16, URG=32 # Capture only TCP SYN packets (new connections): sudo tcpdump -nn 'tcp[13] == 2' # or equivalently: sudo tcpdump -nn 'tcp[tcpflags] == tcp-syn' # SYN + ACK (server response to SYN): sudo tcpdump -nn 'tcp[13] == 18' # SYN(2) + ACK(16) = 18 # Only RST packets (rejected or aborted connections): sudo tcpdump -nn 'tcp[13] & 4 != 0' # or: sudo tcpdump -nn 'tcp[tcpflags] & tcp-rst != 0' # Only FIN packets (graceful close): sudo tcpdump -nn 'tcp[tcpflags] & tcp-fin != 0' # Practical: watch for connection resets to a web server: sudo tcpdump -nn -i eth0 'tcp[tcpflags] & tcp-rst != 0 and port 80'
8. Real Troubleshooting Scenarios
Scenario 1: Verify DNS Resolution
# Problem: host cannot resolve DNS names; check if DNS traffic is flowing sudo tcpdump -nn -i eth0 -vv 'port 53' # Expected output (query then response): # 14:30:00 IP 192.168.1.100.54321 > 192.168.1.1.53: A? google.com. (28) # 14:30:00 IP 192.168.1.1.53 > 192.168.1.100.54321: A google.com. [1au] 1/0/1 A 142.250.80.46 (56) # # Diagnosis: # If you see query but NO response: DNS server not reachable / not responding # If no query at all: application not sending DNS / routing issue # 'A?' = Type A (IPv4) query; 'AAAA?' = Type AAAA (IPv6) query
Scenario 2: Watch the TCP Three-Way Handshake
# Problem: TCP connection to web server fails; confirm whether handshake completes sudo tcpdump -nn -i eth0 'tcp and host 93.184.216.34 and port 80' # Expected 3-way handshake: # Client > Server: Flags [S] (SYN) # Server > Client: Flags [S.] (SYN-ACK) # Client > Server: Flags [.] (ACK) # Then data: Flags [P.] (PSH-ACK with HTTP request) # Diagnosis: # Only [S] and no [S.]: server unreachable / firewall dropping SYN # [S] then [R] or [R.]: port closed on server # [S.] received but connection hangs: ACK lost, routing issue back to client
Scenario 3: Capture DHCP DORA
# Problem: host not getting IP; watch DHCP exchange sudo tcpdump -nn -i eth0 -vv 'udp and (port 67 or port 68)' # Expected DHCP DORA sequence: # Client (0.0.0.0:68) > Broadcast (255.255.255.255:67): DHCP Discover # Server (192.168.1.1:67) > Broadcast (255.255.255.255:68): DHCP Offer # Client > Broadcast: DHCP Request # Server > Broadcast: DHCP ACK # # Diagnosis: # Discover but no Offer: no DHCP server / DHCP snooping blocking # Offer but no ACK: address conflict / server issue
Scenario 4: Detect ARP Spoofing
# Watch ARP traffic; detect multiple MACs claiming same IP sudo tcpdump -nn -e -i eth0 arp # Sample output: # 14:35:10 00:11:aa:bb:cc:dd > ff:ff:ff:ff:ff:ff ARP, Request who-has 192.168.1.1 tell 192.168.1.100 # 14:35:10 00:11:22:33:44:55 > ff:ff:ff:ff:ff:ff ARP, Request who-has 192.168.1.1 tell 192.168.1.100 # # Red flag: same IP answered by two different MACs in short succession # 14:35:11 00:aa:bb:cc:dd:ee > ff:ff:ff:ff:ff:ff ARP, Reply 192.168.1.1 is-at 00:aa:bb:cc:dd:ee # 14:35:11 00:ff:ee:dd:cc:bb > ff:ff:ff:ff:ff:ff ARP, Reply 192.168.1.1 is-at 00:ff:ee:dd:cc:bb # Two different MACs both claiming to be 192.168.1.1 = ARP spoofing attack!
Scenario 5: Monitor ICMP Connectivity
# Problem: ping to 8.8.8.8 fails; verify ICMP at wire level sudo tcpdump -nn -i eth0 'icmp and host 8.8.8.8' # Expected ping output: # 14:40:00 IP 192.168.1.100 > 8.8.8.8: ICMP echo request, id 1234, seq 1, length 64 # 14:40:00 IP 8.8.8.8 > 192.168.1.100: ICMP echo reply, id 1234, seq 1, length 64 # # Diagnosis: # Request but no reply: routing problem / firewall at 8.8.8.8 blocking ICMP # No request seen: local routing issue / default route missing # ICMP unreachable received: router along path reports no route to destination
9. Advanced Filtering Techniques
# ── Capture specific subnet traffic excluding management ─────────────────── sudo tcpdump -nn -i eth0 'src net 192.168.0.0/16 and not dst port 22' # ── Watch only new TCP connections (SYN only, no ACK) ────────────────────── sudo tcpdump -nn 'tcp[tcpflags] == tcp-syn' # ── Find all RST packets (connection resets -- sign of trouble) ──────────── sudo tcpdump -nn 'tcp[tcpflags] & tcp-rst != 0' # ── Capture HTTP GET requests only ──────────────────────────────────────── # Match the ASCII 'GET' in the TCP payload: sudo tcpdump -nn -A 'tcp dst port 80 and tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420' # 0x47455420 = 'GET ' in ASCII # ── Capture packets larger than 1400 bytes (find large transfers) ────────── sudo tcpdump 'greater 1400' # ── Capture packets smaller than 64 bytes (runt frames) ─────────────────── sudo tcpdump 'less 64' # ── IPv6 only ───────────────────────────────────────────────────────────── sudo tcpdump -nn ip6 # ── Filter by ICMP type (type 8 = echo request / ping) ──────────────────── sudo tcpdump 'icmp[icmptype] == icmp-echo' # ── Capture all traffic, dump to stdout, compress with gzip ─────────────── sudo tcpdump -i eth0 -s 0 -w - | gzip -c > /tmp/capture.pcap.gz
10. Integrating with Wireshark and Other Tools
# ── Convert/open .pcap in Wireshark ───────────────────────────────────────
# On local machine: just double-click the .pcap file (if Wireshark installed)
# On Linux GUI:
wireshark capture.pcap &
# ── Live remote capture in Wireshark via SSH ──────────────────────────────
ssh user@remote-server 'sudo tcpdump -U -i eth0 -s 0 -w - "port 80"' | wireshark -k -i -
# -U = unbuffered output (important for live streaming); -w - = write to stdout
# ── Pipe to tshark (CLI Wireshark) for analysis ───────────────────────────
sudo tcpdump -i eth0 -s 0 -w - | tshark -r - -T fields -e ip.src -e ip.dst -e tcp.dstport
# ── Use grep to find patterns in ASCII output ─────────────────────────────
sudo tcpdump -nn -A -i eth0 'port 80' | grep -i 'GET\|POST\|Host:'
# ── Count packets per source IP (basic traffic analysis) ──────────────────
sudo tcpdump -nn -i eth0 | awk '{print $3}' | cut -d. -f1-4 | sort | uniq -c | sort -rn | head
# ── Extract URLs from HTTP traffic ────────────────────────────────────────
sudo tcpdump -nn -A -i eth0 'port 80' | grep -oP '(?<=GET ).*(?= HTTP)'
11. Promiscuous Mode and Interface Modes
By default, tcpdump places the network interface into promiscuous mode — the NIC accepts ALL frames on the wire, not just those addressed to its own MAC. This allows capturing traffic between other hosts on the same segment (useful on hubs; ineffective on switched networks without a mirror/SPAN port).
Promiscuous mode on a HUB (captures all traffic):
Hub -- PC-A, PC-B, PC-C, tcpdump-host
tcpdump sees all frames (PC-A to PC-B, PC-B to PC-C, etc.)
Promiscuous mode on a SWITCH (limited):
Switch forwards frames only to correct destination port.
tcpdump on Port-4 only sees:
- Traffic TO/FROM the tcpdump host
- Broadcasts and unknown unicast floods
- NOT traffic between PC-A and PC-B (different ports)
Solution for full capture on a switch:
- SPAN port (Switched Port Analyser / port mirroring):
Switch(config)# monitor session 1 source interface Gi0/1 - 3
Switch(config)# monitor session 1 destination interface Gi0/24
Connect tcpdump host to Gi0/24 -- sees ALL traffic from Gi0/1-3
- TAP device (hardware): physically intercepts the link; passive
12. Security, Legal, and Ethical Considerations
- Authorisation is mandatory. Capturing traffic on a network you do not own or have explicit written permission to test is illegal in most jurisdictions (e.g., Computer Fraud and Abuse Act in the US, Computer Misuse Act in the UK). Always obtain written authorisation before capturing.
- Sensitive data in captures. PCAP files may contain cleartext passwords (HTTP, FTP, Telnet, SNMPv1/v2), authentication tokens, session cookies, and private health or financial data. Handle .pcap files as sensitive data: encrypt at rest, restrict access, delete when no longer needed.
- Performance impact. Promiscuous mode + no filter on a busy interface can consume significant CPU and disk. Always use specific BPF filters in production.
- Log your captures. Document: interface, filter used, start/end time, purpose, and who authorised the capture. This protects you and creates an audit trail.
- Privacy regulations. GDPR (EU), HIPAA (US healthcare), and other regulations may restrict capturing and storing user traffic even on your own network. Consult your organisation's data protection policy.
13. Hands-On Practice Command Reference
| Task | Command | Goal |
|---|---|---|
| List interfaces | sudo tcpdump -D |
Find the correct interface name |
| Capture all, 30 sec | sudo timeout 30s tcpdump -i eth0 -nn |
Observe live packet flow without DNS resolution |
| Filter by source IP | sudo tcpdump -nn -i eth0 src host 192.168.1.100 |
See only traffic originating from one host |
| Capture HTTP traffic | sudo tcpdump -nn -A -i eth0 port 80 |
Read HTTP headers and content in ASCII |
| Save 100 packets | sudo tcpdump -i eth0 -c 100 -s 0 -w sample.pcap |
Full-packet capture for Wireshark analysis |
| Read pcap with filter | tcpdump -r sample.pcap 'port 53' |
Extract DNS traffic from saved capture |
| Verbose DNS watch | sudo tcpdump -nn -vv -i eth0 port 53 |
See full DNS query/response details |
| Hex + ASCII payload | sudo tcpdump -nn -X -i eth0 -c 5 port 80 |
Inspect HTTP payload in hex and ASCII |
| Watch ICMP only | sudo tcpdump -nn -i eth0 icmp |
Debug ping failures; verify ICMP at wire level |
| SYN packets only | sudo tcpdump -nn 'tcp[tcpflags]==tcp-syn' |
Watch new connection attempts |
| Rotating capture | sudo tcpdump -i eth0 -s 0 -w /tmp/cap-%H%M%S.pcap -G 300 -W 12 |
5-minute rotating files, keep 12 (1 hour of history) |
| ICMP excluding host | sudo tcpdump 'icmp and not host 10.1.1.1' |
Exclude noisy/known-good host from ICMP capture |
14. Key Points & Exam Tips
- Basic syntax:
sudo tcpdump [options] [filter]. Requires root on most systems (sudo) for raw socket access. - -i selects interface (
-i eth0,-i any). Use-Dto list available interfaces. - -w writes PCAP file; -r reads PCAP file.
No root needed for
-r. Apply filters on both capture and read. - -c limits packet count. -n disables DNS resolution (faster, cleaner). -nn disables both DNS and port name resolution.
- -X shows payload in hex + ASCII. -A shows ASCII only (cleaner for HTTP). -XX includes Ethernet header in hex output. -s 0 captures the full packet (default truncates).
- BPF primitives:
host,net,port,src,dst,tcp,udp,icmp,arp. Combine withand,or,not. - TCP flags in output: [S]=SYN (new connection), [S.]=SYN-ACK, [.]=ACK, [P.]=PSH-ACK (data), [F.]=FIN (close), [R]=RST (reset/reject).
- File rotation:
-Cby size (MB);-Gby time (seconds);-Wlimits file count (circular buffer). Use timestamp in filename:-w cap-%H%M%S.pcap. - On switched networks, tcpdump only sees traffic to/from the capture host plus broadcasts. Use a SPAN/mirror port on a managed switch to capture traffic between other hosts.
- Always use filters in production to minimise CPU load and capture size. Always have authorisation before capturing — packet capture without permission is illegal.
Related pages: How DNS Works | DNS Record Types | DHCP How It Works | Common Port Numbers | show ip route | Troubleshooting Methodology | End-to-End Troubleshooting Lab