前提是:linux服务器上已经安装过wireshark
1.抓取网卡是eth0的保存到home文件夹下的ir.cap文件
tcpdump -i eth0 -w /home/ir.cap
2.抓 192.168.1.123的包
tcpdump -i eth1 host 192.168.1.123 -w /tmp/xxx.cap
3.抓192.168.1.123的80端口的包
tcpdump -i eth1 host 192.168.1.123 and port 80 -w /tmp/xxx.cap
4.抓192.168.1.123的icmp的包
tcpdump -i eth1 host 192.168.1.123 and icmp -w /tmp/xxx.cap
5.抓192.168.1.123的80端口和110和25以外的其他端口的包
tcpdump -i eth1 host 192.168.1.123 and ! port 80 and ! port 25 and ! port 110 -w /tmp/xxx.cap
6.抓vlan 1的包
tcpdump -i eth1 port 80 and vlan 1 -w /tmp/xxx.cap
7.抓pppoe的密码
tcpdump -i eth1 pppoes -w /tmp/xxx.cap
8.以100m大小分割保存文件, 超过100m另开一个文件 -C 100m
抓10000个包后退出 -c 10000
9.后台抓包, 控制台退出也不会影响:
nohup tcpdump -i eth1 port 110 -w /tmp/xxx.cap &