In CentOS 7, firewalld
is used by default to administrate the firewall. If you
want to switch back to iptables
, you might run into the problem that your
firewall rules are not automatically loaded when the system boots. So let’s look
at this closer.
To remove firewalld
and install iptables
, I assume that you have executed
something like
$ yum remove firewalld
$ yum install iptables iptables-services
The iptables service allows you to save the current ruleset.
$ service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
However, if we reboot now, we notice that iptables -L
will print empty
firewall tables.
The problem is that the service, which is responsible for restoring the ruleset at boot, does not start by default. We need to enable it manually:
$ systemctl enable iptables
This should be it. Rebooting should reload the configuration stored in
/etc/sysconfig/iptables
.
This might also interest you