CentOS7防火墙和CentOS6不一样,
配置后执行service iptables save
出现"Failed to restart iptables.service: Unit iptables.service failed to load: No such file or directory."错误,
在CentOS 7或RHEL 7或Fedora中
防火墙由firewalld来管理,需要使用新的命令进行管理。
假如采用传统请执行一下命令:
systemctl stop firewalld
systemctl mask firewalld
并且安装iptables-services:
yum install iptables-services
设置开机启动:
systemctl enable iptables
systemctl [stop|start|restart] iptables
#or
service iptables [stop|start|restart]
service iptables save
#or
/usr/libexec/iptables/iptables.init save
快速初始化
防火墙:
systemctl mask firewalld
systemctl stop firewalld
yum install iptables-services
systemctl enable iptables
systemctl start iptables
service iptables save