IPset区域封禁

 yum -y install ipset

 wget -P . http://www.ipdeny.com/ipblocks/data/countries/cn.zone
 ipset -N cnip hash:net
 for i in $(cat /root/cn.zone ); do ipset -A cnip $i; done
 iptables -I INPUT -p tcp -m set --match-set cnip src --dport 22 -j DROP

 

posted @ 2020-03-30 17:20  Ray_chen  阅读(206)  评论(0编辑  收藏  举报