注:本机 eth0
为 192.168.0.214,
host
指从本机发出
或发送到本机
,dst
指发送到本机
,src
指从本机发出
-i tap10
指数据包通过tap10
设备,一定要保留
host 192.168.0.214
可以去掉
下载
yum install -y tcpdump
使用
- 截获本机和主机
192.168.0.102
之间的包
tcpdump -n -i eth0 host 192.168.0.214 and 192.168.0.102
- 截获
从本机发出
或发送到本机
的数据
tcpdump -n -i eth0 host 192.168.0.214
- 截获
发送到本机
的数据
tcpdump -n -i eth0 dst 192.168.0.214
- 截获
发送到多个服务器
的数据
tcpdump -n -i eth0 dst 192.168.0.214 or 192.168.0.215
- 截获
进入服务器
的TCP
包
tcpdump -n -i eth0 dst 192.168.0.214 or 192.168.0.215 and tcp
- 端口非
22
的tcp
包
tcpdump -n -i eth0 dst 192.168.0.214 or 192.168.0.215 and port ! 22 and tcp
- 通过
eth0
设备的包
tcpdump -n -i eth0
- 抓包保存
cap
文件
tcpdump -i eth0 -w /tmp/xxx.cap