分IP实时流量监测的脚本
tomato下没有分ip的实时流量检测,下面的脚本能显示各ip的上传及下载流量.(考虑到命令执行的耗时,显示的值会比实际值偏大)#!/bin/sh
iptables -N acc-in
iptables -N acc-out
for IP in `cat /proc/net/arp | grep br0 | awk '{printf $1"\t"}'`; do
iptables -A acc-in -d $IP -j RETURN
iptables -A acc-out -s $IP -j RETURN
done
iptables -I FORWARD -o br0 -i ! br0 -j acc-in
iptables -I FORWARD -i br0 -o ! br0 -j acc-out
sleep 1
echo Donwload
iptables -L acc-in -v | grep 0 | awk '{printf $9"\t"$2" Bytes/s\n"}'
echo
echo Upload
iptables -L acc-out -v | grep 0 | awk '{printf $8"\t"$2" Bytes/s\n"}'
iptables -D FORWARD -i br0 -o ! br0 -j acc-out
iptables -F acc-out
iptables -X acc-out
iptables -D FORWARD -o br0 -i ! br0 -j acc-in
iptables -F acc-in
iptables -X acc-in
我现在用的是TOMATO1.19限速版的,如何把上面这段文字输入进去啊? 下载附件,解压后把flux.sh复制到jffs上就能运行了. 我没有jffs啊?去哪里下载?还有这个东西写进去后安全吗?会不会把路由器变砖的。
[ 本帖最后由 jacky6689 于 2008-11-1 18:35 编辑 ] (touxiang:
页:
[1]