CentOS 7 iptables not persistent after reboot

Solution 1:

i think you need to enable the service with:

systemctl enable iptables.service

and you need to run the iptables init script to save your rules like this:

/usr/libexec/iptables/iptables.init save

Solution 2:

Ensure you have the iptables-services package installed:

rpm -aq iptables-services

If not install it:

yum install iptables-services

You can then use the service command to control it just like with previous versions of CentOS:

service iptables save

The save, stop, start, restart commands will all work and it should load on boot.

Solution 3:

I got around this by adding 'service iptables stop \ iptables --flush' command appended to the bottom /etc/rc.d/rc.local

My environment was Centos 7 KVM and my issue was that libvirt would re-populate the iptables on a reboot - blocking access to my virtual machines.