錯誤信息以下:shell
[root]# service iptables start Redirecting to /bin/systemctl start iptables.service Failed to start iptables.service: Unit iptables.service failed to load: No such file or directory.
解決方法以下:
一直用CentOS 6 習慣了,一下沒適應過來。防火牆配置後執行service iptables save 出現」Failed to restart iptables.service: Unit iptables.service failed to load: No such file or directory.」錯誤,spa
在CentOS 7或RHEL 7或Fedora中防火牆由firewalld來管理,固然你能夠還原傳統的管理方式。或則使用新的命令進行管理。rest
假如採用傳統請執行一下命令:code
而且安裝iptables-services:systemctl stop firewalld systemctl mask firewalld
設置開機啓動:yum install iptables-services
systemctl enable iptables
iptables啓動、關閉、保存:
systemctl [stop|start|restart] iptables #or service iptables [stop|start|restart] service iptables save #or /usr/libexec/iptables/iptables.init save