#!/bin/sh
iptables -F FORWARD
cat /proc/net/ip_conntrack|grep '192.168.'|awk '{if($1=="tcp"){print $5;}else{pr
int $4}}'|cut -d '=' -f 2|sort|uniq -c|sort -nr|grep -v '192.168.200.255'|head -
n 5 > /home/walkman/myshell/ipconn.dat
while read line
do
t1=`echo "$line"|cut -d " " -f 1`
t2=`echo "$line"|cut -d " " -f 2`
if [ $t1 -gt 600 ];then
iptables -A FORWARD -s $t2 -j DROP
fi
#echo $t1 $t2
done < /home/walkman/myshell/ipconn.dat
阅读(756) | 评论(0) | 转发(0) |