Iptables - RHEL 7

Latest response

Iptables after restart , restores the default rules ... RHEL 7

Need help.


You could try using the permanent argument to firewall-cmd to ensure the change remains after a reboot ie firewall-cmd --zone=publicweb --add-service=ssh --permanent

Hi Martin, I have removed firewalld package from the system, i want to use iptables. even after flushing the rule, when the system is restarted it again restores the default rules. Which i dont want.

Once you get the firewall into the state you want, have you saved the rules?

When you run commands like iptables -A INPUT whatever that only changes the running configuration. Saving the changes to disk is a separate operation.

You can service iptables save to write the running rules to the /etc/sysconfig/iptables configuration file on disk.

The systemd unit and initscript are provided by the iptables-services package. This needs to be installed.

Hi Jamie, After flushing the default rule then i added port 80 accept rule, when i restarted the system. It is again showing me the default rule with the rule of port 80 which i added.

I don't want to use default rules... need your help pls

What is the contents of /etc/sysconfig/iptables
and output of
iptables -L