Linux下 tcpdump
上一篇 /
下一篇 2010-04-02 16:06:44
/ 个人分类:网络知识
tcpdump的命令格式为:tcpdump [-i 网卡][-s 0][-VV][port 端口][-w file.cap]
参数解析: [-i 网卡]------执行tcpdump的网卡
[-s 0]------不指定包的大小
[-VV]------输出详细的报文信息
[port 端口]------执行tcpdump的服务器的端口
[-w file.cap]------指定将监听到的数据包写入文件中保存
例:tcpdump -i eth6 -s 0 -vv port 53 -w test.cap
也可以不指定端口进行抓包
例
tcpdump -i eth6 -s 0 -vv host IP1 and IP2 -w test.cap
--抓经过IP1和IP2的包
tcpdump -i eth88 -s 0 -vv host IP1 and \(IP2 or IP3\) -w test.cap
--抓经过IP1和IP2或IP3的包
tcpdump -i eth88 -s 0 -vv host IP1 and !IP2 -w test.cap
--抓经过IP1和其他IP的包,除了IP2
收藏
举报
TAG: