CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤。所以你编辑的 Iptables 规则 只能一次生效;
方法如下(方便自己以后查阅):
1、 关闭 默认的 firewall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、写好自己的规则
规则处 暂时不详述了,博客里有一章专门说道 规则
http://blog.hlcert.com/287.html
3、设置开机启动
systemctlenable iptables.service #设置防火墙开机启动
参考文献