歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 解決 RHEL 7/ CentOS 7/Fedora 出現Unit iptables.service failed to load

解決 RHEL 7/ CentOS 7/Fedora 出現Unit iptables.service failed to load

日期:2017/2/28 13:53:56   编辑:Linux教程

解決 RHEL 7/ CentOS 7/Fedora 出現Unit iptables.service failed to load

防火牆配置後執行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|reload] iptables(分開執行)

保存設置:

service iptables save 或者 /usr/libexec/iptables/iptables.init save

Copyright © Linux教程網 All Rights Reserved