CentOS清空iptables规则

1、查看iptables配置
iptables -L

2、清除默认链的规则
iptables -F

3、清除自定义链
iptables -X

4、保存当前规则
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.
先安装服务
yum install iptables-services

5、重启服务
systemctl restart iptables