Centos 7 => Automatic iptables rules load

Support for security such as Firewalls and securing linux
Post Reply
jejedu67
Posts: 53
Joined: 2015/12/07 20:01:46

Centos 7 => Automatic iptables rules load

Post by jejedu67 » 2018/10/29 23:47:35

Hi,

I want to know if there is a solution in order to load automatically iptables rules after each restart, without going to SSH and load it myself.

Thank you very much

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Centos 7 => Automatic iptables rules load

Post by TrevorH » 2018/10/30 02:59:31

If using iptables-services and not firewalld (the default) then your saved rules are in /etc/sysconfig/iptables and can be updated from the running set of currnet rules by running service iptables save. The rules are loaded from there at reboot/restart if iptables.service is enabled (systemctl is-enabled iptables).

If you use firewalld which is default then you can use firewall-cmd --runtime-to-permanent to save the running rules and/or run firewall-cmd twice, once with and once without --permanent.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply