CentOS7出現Unit iptables.service could not be found


CentOS7默認的防火牆不是iptables,而是firewalle.

出現此情況可能是iptables防火牆未安裝。

#停止firewalld服務

systemctl stop firewalld

#禁用firewalld服務

systemctl mask firewalld

開啟

systemctl unmask 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

然后

service iptables status

開啟: service iptables start

關閉: service iptables stop


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM