• 博客园logo
  • 会员
  • 周边
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

韩工

  • 博客园
  • 管理

公告

View Post

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

  

 

征途漫漫,惟有奋斗!

posted on 2024-10-17 20:47  认真的韩工  阅读(33)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3