Assertion failed for IPv4 firewall with iptables.

 Linux  iptables   2017-04-25 09:34 

环境:CentOS7.3

状况:执行systemctl start iptables启动防火墙出现故障,如下:

root@bj-aliyun:sysconfig systemctl start iptables
Assertion failed on job for iptables.service.

systemctl status iptables或者查看/var/log/message也可以看到此错误,经查,是因为没有默认的规则文件/etc/sysconfig/iptables(我为了测试之前删掉了,所以出现此问题)。

解决:

service iptables save
systemctl stop firewalld
systemctl disable  firewalld
systemctl start iptables
systemctl status iptables
systemctl enable iptables

其含义分别为:

保存规则,停掉firewalld,禁止firewalld开机自启动,启动iptables,查看iptables状态,并设置开机自启动。