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
systemctl start iptables
开机启动iptables:
systemctl enable iptables
安装或更新服务:
yum install iptables-services
再执行service iptables save
3.重启iptables服务:
service iptables restart
执行完毕之后/etc/syscofig/iptables文件就有了
代码:
systemctl stop firewalld yum -y install iptables-services systemctl enable iptables systemctl start iptables service iptables save service iptables restart