Howtos / Articles

Save iptables firewall config on CentOS 6

Changes you make to iptables firewall rules only exist for the current boot, and if you don’t save the config, you will loose any changes upon rebooting.

CentOS 6 blocks most incoming ports by default, so you will generally have to make changes to the firewall if you install any new packages. Thankfully CentOS 6 provides the ability to easily save the configuration.

To save the current iptables firewall config, issue the following command:

# service iptables save

Example output:

# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]
#

During the next system boot up, or the next time the iptables rules are reloaded, your firewall settings will be reloaded.



Share this howto article!
  • Facebook
  • Twitter
  • Reddit
  • email

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>