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
README.md 867 Bytes
Copy Edit Web IDE Raw Blame History
Intern authored 2014-10-25 17:55 . 添加一些帮助延伸

国内一些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参数的说明。

Comment ( 0 )

Sign in for post a comment

Shell
1
https://gitee.com/intern/Firewall-Whitelist.git
git@gitee.com:intern/Firewall-Whitelist.git
intern
Firewall-Whitelist
Firewall Whitelist
master

Search