4 Star 1 Fork 0

Intern / Firewall Whitelist

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

国内一些CDN的iptables白名单添加脚本。

CentOS上可以执行:service iptables save保存规则。

需要注意的是Debian/Ubuntu上iptables不会保存规则。

需要按如下步骤进行,让网卡关闭是保存iptables规则,启动时加载iptables规则:

创建/etc/network/if-post-down.d/iptables 文件,添加如下内容:

#!/bin/bash
iptables-save > /etc/iptables.rules

执行:chmod +x /etc/network/if-post-down.d/iptables添加执行权限。

创建/etc/network/if-pre-up.d/iptables 文件,添加如下内容:

#!/bin/bash
iptables-restore < /etc/iptables.rules

执行:chmod +x /etc/network/if-pre-up.d/iptables 添加执行权限。

关于更多的iptables的使用方法可以执行:iptables --help或网上搜索iptables参数的说明。

Comments ( 0 )

Sign in for post a comment

About

国内免费CDN 的IP防火墙白名单添加脚本 spread retract
Shell
Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more
Shell
1
https://gitee.com/intern/Firewall-Whitelist.git
git@gitee.com:intern/Firewall-Whitelist.git
intern
Firewall-Whitelist
Firewall Whitelist
master

Search