解决CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory.

来源:互联网 发布:ubuntu怎么连无线 编辑:程序博客网 时间:2024/05/18 00:15

错误,在CentOS 7或RHEL 7或Fedora中防火墙由firewalld来管理,当然你可以还原传统的管理方式。或则使用新的命令进行管理。
假如采用传统请执行一下命令:

systemctl stop firewalldsystemctl mask firewalld

并且安装iptables-services:

yum install iptables-services

设置开机启动:

systemctl enable iptables(开机启动)
systemctl [stop|start|restart] iptables//orservice iptables [stop|start|restart]

保存设置

service iptables save
//or/usr/libexec/iptables/iptables.init save
阅读全文
0 0