cat /proc/net/ip_conntrack | cut -d ' ' -f 10 | cut -d '=' -f 2 | sort |
uniq -c | sort -nr | head -n 5
/proc/net/ip_conntrack 存放的是ip_conntrack 每个ip_conntrack 占用340字节。
默认256M内存是65536个
iptable -p tcp -s 10.0.0.0/8 -j SNAT and DNAT
iptable -p tcp -m limit --limit 100/s -j DROP
iptable -p tcp -j SNAT DNAT
正常内部网络 snat dnat
其他 网络(10.0.0.0/8 已经匹配过) 如果包达到100个每秒 那么drop,如果没不匹配那条规则则到下条SNAT DNAT
参考
http://blog.chinaunix.net/u/166/showart_702373.html
http://blog.chinaunix.net/u2/63462/showart_496563.html
http://hi.baidu.com/sing520/blog/item/e6527a593884272f2934f043.html
阅读(333) | 评论(0) | 转发(0) |