1,tcpdump未指定網卡時默認監聽第一個網卡
2,可以通過-i指定網卡,如:
tcpdump -i eth0(如果不想限定網卡,可以使用tcpdump -i any)
3, -w參數可以將網絡信息寫入文件,如:
tcpdump -i eth0 -w net.txt
4, host參數可以指定主機
tcpdump -i eth0 host 127.0.0.1
tcpdump -i eth0 127.0.0.1 and 192.168.223.1 (監聽127.0.0.1與192.168.223.1的通信)
tcpdump -i eth0 127.0.0.1 and !192.168.223.2 (監聽127.0.0.1不與192.168.223.2的通信)
5,監視本機80端口協議爲tcp的數據
tcpdump -i eth0 tcp port 80 (還可以支持協議udp)
6,-vv參數可以查看詳細信息
tcpdump -i eth0 tcp port 80 -vv