Cheap domain hosting, cheap domain names & web page promotion services
  

 Home

Red Hat Linux 9: Red Hat Linux Reference Guide
PrevChapter 16. iptablesNext

16.4. Storing iptables Information

Rules created with the iptables command are stored in memory. If the system is restarted after setting up iptables rules, they will be lost. In order for netfilter rules to persist through system reboot, they need to be saved. To do this, log in as root and type:

/sbin/service iptables save

This executes the iptables init script, which runs the /sbin/iptables-save program and writes the current iptables configuration to the /etc/sysconfig/iptables. This file should only be readable by root.

The next time the system boots, the iptables init script will reapply the rules saved in /etc/sysconfig/iptables by using the /sbin/iptables-restore command.

While it is always a good idea to test a new iptables rule before committing it to the /etc/sysconfig/iptables file, it is possible to copy iptables rules into this file from another system's version of this file. This provides a quick way to distribute sets of iptables rules to multiple machines.

ImportantImportant
 

If distributing the /etc/sysconfig/iptables file to other machines, type /sbin/service iptables restart for the new rules take effect.


PrevHomeNext
Options Used in iptables CommandsUpAdditional Resources
 

 

 

 
 

Disclaimer: For authoritative source or latest update to this documentation, please refer to http://www.redhat.com/docs/manuals/linux/

 

 
Quotes: News is what a chap who doesn't care much about anything wants to read. And it's only news until he's read it. After that it's dead.