首页 > 代码库 > Openwrt 获取客户端实时流量
Openwrt 获取客户端实时流量
echo "Collecting data..."echo ""cat /proc/net/arp | grep : | grep ^192 | grep -v 00:00:00:00:00:00 | awk ‘{print $1}‘ > mac-ipiptables -N UPLOADiptables -N DOWNLOADwhile read line;do iptables -I FORWARD 1 -s $line -j UPLOAD;done < mac-ipwhile read line;do iptables -I FORWARD 1 -d $line -j DOWNLOAD;done < mac-ipsleep 1echo "Download speed:"echo ""iptables -nvx -L FORWARD | grep DOWNLOAD | awk ‘{print $2/1024/1" KB/s ",$1/10" packets/s", $9}‘ | sort -n -recho ""echo "Upload speed:"echo ""iptables -nvx -L FORWARD | grep UPLOAD | awk ‘{print $2/1024/1" KB/s ",$1/10" packets/s", $8}‘ | sort -n -r while read line;do iptables -D FORWARD -s $line -j UPLOAD;done < mac-ipwhile read line;do iptables -D FORWARD -d $line -j DOWNLOAD;done < mac-ipiptables -X UPLOADiptables -X DOWNLOAD
Openwrt 获取客户端实时流量
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。