ubnt解决方案
查看: 4360|回复: 3

[分享] 分IP实时流量监测的脚本

[复制链接]

1

回帖

34

积分

7 小时

在线时间

新兵上阵

注册时间
2008-10-20
金币
19 个
威望
2 个
荣誉
0 个

尚未签到

发表于 2008-11-1 15:48 |显示全部楼层
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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册 微信登录

x

评分

1

查看全部评分

1247

回帖

8483

积分

234 小时

在线时间

中校

注册时间
2008-6-3
金币
6680 个
威望
46 个
荣誉
22 个

尚未签到

发表于 2008-11-1 17:24 |显示全部楼层
强人!
回复

使用道具 举报

231

回帖

2217

积分

271 小时

在线时间

少校

注册时间
2008-8-29
金币
1896 个
威望
10 个
荣誉
0 个
累计签到:4 天
连续签到:0 天
[LV.20]漫游旅程
发表于 2008-11-2 02:02 |显示全部楼层
不是很明白怎么使用。。。
回复

使用道具 举报

1

回帖

2

积分

2 小时

在线时间

预备兵

注册时间
2008-11-28
金币
1 个
威望
0 个
荣誉
0 个

尚未签到

发表于 2008-11-28 05:57 |显示全部楼层

Hello Leechange (and other)

I cannot find another way to contact you so sorry for this place.
Iam realy interested by your delphi source of pack/unpacktomato for modification to allow unsquashfs under windows. It's for an another hardware (EMTEC S800 MovieCube).

Contact me please cybermomo@techemail.com


Again sorry for this missplace and for my english language.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册 微信登录

本版积分规则

站点统计 | Archiver | 手机版 | 无线门户 ( 粤ICP备11076993号|粤公网安备44010602008359号 ) |网站地图

GMT+8, 2024-6-2 07:14

返回顶部 返回列表