Centos 7 之service iptables save 指令使用失败的结局方案

今天我保存转发规则的时候,发现service iptables save 无效,而且报错 
[root@localhost bin]# 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.,产生这个问题的原因是iptables的服务没有安装

安装iptables服务
安装完成iptables后,在使用service iptables save方法就没有问题了

#安装或更新服务
yum install iptables-services 

#启用iptables
systemctl enable iptables 

#启动iptables
systemctl start iptables 打开iptables
--------------------- 

关闭防火墙
 #停止firewall
systemctl stop firewalld.service

#禁止firewall开机启动
systemctl disable firewalld.service 

#查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
firewall-cmd --state 


原文:https://blog.csdn.net/yelllowcong/article/details/78229862 

猜你喜欢

转载自blog.csdn.net/whalefall/article/details/85181863