Có lẽ đây là một lệnh quen thuộc mà bất kỳ người quản trị hệ thống mạng Linux/Unix đều biết Smile. Với tcpdump chúng ta có thể thực hiện bắt gói tin từ dữ liệu ra vào trên các giao tiếp mạng. Ví dụ:
# tcpdum –i eth1
[root@server ~]# tcpdump -i eth1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
15:18:46.719161 IP 192.168.1.111.ssh >; 192.168.1.13.valisys-lm: Flags [P.], seq 1756740101:1756740297, ack 3536611579, win 142, length 196
15:18:46.719474 IP 192.168.1.13.valisys-lm >; 192.168.1.111.ssh: Flags [.], ack 196, win 4305, length 0
15:18:46.719861 IP 192.168.1.111.43629 >; google-public-dns-a.goo0915:18:46.719861 IP 192.168.1.111.43629 >; google-public-dns-a.google.com.domain: 49260+ PTR? 13.1.168.192.in-addr.arpa. (43)
Bắt gói tin từ eth1 và lưu vào tệp tin thongke.pcap
# tcpdump -w thongke.pcap -i eth1
[root@server ~]# tcpdump -w thongke.pcap -i eth1
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
9 packets captured
9 packets received by filter
0 packets dropped by kerne