用tcpdump抓包,下载软件wireshark解析包。
抓包命令:tcpdump -i eth1 host 192.168.1.1 -w /tmp/***.cap
用ifconfig -a 查看当前linux是否是eth1,/tmp/***.cap表示文件存放的位置。
tcpdump -i eth1 host 192.168.1.1 and (192.168.1.2 or 192.168.1.3) -w /tmp/***.cap
tcpdump -i eth1 host 192.168.1.1 and !192.168.1.2 -w /tmp/***.cap
主机发送的所有请求:tcpdump -i eth1 src host 192.168.1.1 -w /tmp/***.cap
主机接收的所有请求:src改成dst
抓取主机端口80:tcpdump -i eth1 src host 192.168.1.1 and tcp port 80 -w /tmp/***.cap