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