centos7中沒有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文件就有了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章