systemctl enable iptables
但重启后当我尝试service iptables status ,它显示:
# service iptables status Redirecting to /bin/systemctl status iptables.service iptables.service - IPv4 firewall with iptables Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled) Active: inactive (dead)
但是当我手动systemctl start iptables ,它正常启动。
我正在运行Fedora 22。
Fedora 22和Centos 7都装有firewalld作为默认防火墙。 当在同时启用firewalld和iptables的情况下在Centos7上testing时,我得到了同样的行为。
检查systemctl list-unit-files|grep firewalld是否已启用,如果通过以下方式将其禁用:
# systemctl disable firewalld rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service' rm '/etc/systemd/system/basic.target.wants/firewalld.service'
现在iptables应该在启动时启动。