解決service iptables save出錯please try to use systemctl


  

# 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
systemctl mask firewalld

 

然后安裝iptables-services

yum install iptables-services

 

設置開機啟動防火牆

systemctl enable iptables

 

可以使用下面命令管理iptables

systemctl [stop|start|restart] iptables

 

這時可以保存防火牆規則了

service iptables save
or
/usr/libexec/iptables/iptables.init save

 

 如果你之后要使用firewall的話:

  執行命令,即可實現取消服務的鎖定

  # systemctl unmask firewalld

  下次需要鎖定該服務時執行

  # systemctl mask firewalld

 


免責聲明!

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



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