ipset安装部署
下载安装包
wget --no-check-certificate https://ipset.netfilter.org/ipset-7.22.tar.bz2
安装部署
bzip2 -d ipset-7.22.tar.bz2 tar -xvf ipset-7.22.tar cd ipset-7.22 ./configure make && make install yum install ipset-service -y ipset create china hash:net hashsize 1024 maxelem 65536 ipset create hk hash:net hashsize 1024 maxelem 65536 ipset create tw hash:net hashsize 1024 maxelem 65536 wget http://www.ipdeny.com/ipblocks/data/countries/cn.zone wget http://www.ipdeny.com/ipblocks/data/countries/hk.zone wget http://www.ipdeny.com/ipblocks/data/countries/tw.zone for cn in `cat cn.zone`; do ipset add china $cn; done for hk in `cat hk.zone`; do ipset add hk $hk; done for tw in `cat tw.zone`; do ipset add tw $tw; done ipset save china -f china.ipset ipset save hk -f hk.ipset ipset save tw -f tw.ipset systemctl enable ipset systemctl start ipset systemctl status ipset
【常见问题】
1) configure: error: Invalid kernel source directory /lib/modules/3.10.0-1160.119.1.el7.x86_64/source
处理方法:
yum -y install kernel-devel **安装内核更新文件** cd /lib/modules/3.10.0-1160.119.1.el7.x86_64/ rm -f build ln -s /usr/src/kernel/3.10.0-1160.119.1.el7.x86_64 build
征途漫漫,惟有奋斗!