centos 7 中沒有iptables 和service iptables save 指令使用失敗問題解決方案


1.任意運行一條iptables防火牆規則配置命令:

iptables -P OUTPUT ACCEPT  

2.對iptables服務進行保存:

service iptables save  

如果上述命令執行失敗報出:The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

解決方法:
systemctl stop firewalld 關閉防火牆
yum install iptables-services 安裝或更新服務
再使用systemctl enable iptables 啟動iptables
最后 systemctl start iptables 打開iptables

再執行service iptables save

3.重啟iptables服務:

service iptables restart

執行完畢之后/etc/syscofig/iptables文件就有了


免責聲明!

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



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