tcpdump tcp -i eth1 -t -s 0 -c 100 and dst port ! 22 and src net 192.168.1.0/24 -w ./target.cap
- -i eth1 指定抓包网口
- -s 0 默认抓包长度68字节,-S 0 默认抓取完整包
- -t : 不显示时间戳
- -c 100 : 只抓取100个数据包
- dst port ! 22 : 不抓取目标端口是22的数据包
- src net 192.168.1.0/24 : 数据包的源网络地址为192.168.1.0/24
- -w ./target.cap : 保存成cap文件,方便用ethereal(即wireshark)分析