1 Star 1 Fork 0

kgh/pve-firewall-ipset

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test.sh 2.53 KB
一键复制 编辑 原始数据 按行查看 历史
kgh 提交于 2022-01-11 15:07 . 更新了blacklist地址
#!/bin/bash
#创建目录
cd /
mkdir -p /ipset/txt/
cd /ipset/txt/
#下载最新的ip list
curl -o all_cn_cidr.txt https://ispip.clang.cn/all_cn_cidr.txt
curl -o chinatelecom_cidr.txt https://ispip.clang.cn/chinatelecom_cidr.txt
curl -o unicom_cnc_cidr.txt https://ispip.clang.cn/unicom_cnc_cidr.txt
curl -o cmcc_cidr.txt https://ispip.clang.cn/cmcc_cidr.txt
curl -o crtc_cidr.txt https://ispip.clang.cn/crtc_cidr.txt
curl -o cernet_cidr.txt https://ispip.clang.cn/cernet_cidr.txt
curl -o gwbn_cidr.txt https://ispip.clang.cn/gwbn_cidr.txt
curl -o othernet_cidr.txt https://ispip.clang.cn/othernet_cidr.txt
curl -o hk_cidr.txt https://ispip.clang.cn/hk_cidr.txt
curl -o mo_cidr.txt https://ispip.clang.cn/mo_cidr.txt
curl -o tw_cidr.txt https://ispip.clang.cn/tw_cidr.txt
curl -o blacklist.txt https://gitee.com/xlkgh/pve-firewall-ipset/raw/master/deny-ip-list.txt
#删除文件
rm -f cluster.fw
#生成新的cluster.fw
#录入ipset
echo "[IPSET all_cn_cidr] # 中国大陆所有IP地址" > cluster.fw
echo "" >> cluster.fw
cat all_cn_cidr.txt >> cluster.fw
echo "" >> cluster.fw
echo "[IPSET chinatelecom_cidr] # 中国电信" >> cluster.fw
echo "" >> cluster.fw
cat chinatelecom_cidr.txt >> cluster.fw
echo "" >> cluster.fw
echo "[IPSET unicom_cnc_cidr] # 中国联通/网通" >> cluster.fw
echo "" >> cluster.fw
cat unicom_cnc_cidr.txt >> cluster.fw
echo "" >> cluster.fw
echo "[IPSET cmcc_cidr] # 中国移动" >> cluster.fw
echo "" >> cluster.fw
cat cmcc_cidr.txt >> cluster.fw
echo "" >> cluster.fw
echo "[IPSET crtc_cidr] # 中国铁通" >> cluster.fw
echo "" >> cluster.fw
cat crtc_cidr.txt >> cluster.fw
echo "" >> cluster.fw
echo "[IPSET cernet_cidr] # 中国教育网" >> cluster.fw
echo "" >> cluster.fw
cat cernet_cidr.txt >> cluster.fw
echo "" >> cluster.fw
echo "[IPSET gwbn_cidr] # 长城宽带/鹏博士" >> cluster.fw
echo "" >> cluster.fw
cat gwbn_cidr.txt >> cluster.fw
echo "" >> cluster.fw
echo "[IPSET othernet_cidr] # 中国其他ISP" >> cluster.fw
echo "" >> cluster.fw
cat othernet_cidr.txt >> cluster.fw
echo "" >> cluster.fw
echo "[IPSET hk_cidr] # 中国香港" >> cluster.fw
echo "" >> cluster.fw
cat hk_cidr.txt >> cluster.fw
echo "" >> cluster.fw
echo "[IPSET mo_cidr] # 中国澳门" >> cluster.fw
echo "" >> cluster.fw
cat mo_cidr.txt >> cluster.fw
echo "" >> cluster.fw
echo "[IPSET tw_cidr] # 中国台湾" >> cluster.fw
echo "" >> cluster.fw
cat tw_cidr.txt >> cluster.fw
echo "" >> cluster.fw
echo "[IPSET blacklist] # 手动黑名单" >> cluster.fw
echo "" >> cluster.fw
cat blacklist.txt >> cluster.fw
echo "" >> cluster.fw
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/xlkgh/pve-firewall-ipset.git
[email protected]:xlkgh/pve-firewall-ipset.git
xlkgh
pve-firewall-ipset
pve-firewall-ipset
master

搜索帮助