openwrt 抓取流量包

来源:互联网 发布:python heapq 编辑:程序博客网 时间:2024/04/16 17:38

编译内核时支持tcpdump工具

Network  ---> <*> tcpdump
编写抓包脚本,内容如下:
#!/bin/ashSTIME=`date +%F"@"%H%M%S`DUMPPID=`ps | grep "tcpdump" | grep "3g-ppp0"`if [ -n $DUMPPID ]then/usr/sbin/tcpdump -i 3g-ppp0 -C 100 -w /mnt/sda1/${STIME}.cap -s 0 &fi
编辑定时执行:

crontab -e
加入一下内容:
*/1 * * * *  /root/tcpdump.sh


2 0
原创粉丝点击