Tuesday, November 11, 2008

How To Start iptables

How To Start iptables

You can start, stop, and restart iptables after booting by using the commands:

# service iptables start
# service iptables stop
# service iptables restart

To get iptables configured to start at boot, use the chkconfig command:.

# chkconfig iptables on

Determining The Status of iptables

# service iptables status

Firewall is stopped.

How to backup running iptables scripts

This example exports the iptables-save output to a text file named firewall-config.

# iptables-save > firewall-config


After editing the firewall-config file with the commands you need, you can reload it into the active firewall rule set with the iptables-restore command.

# iptables-restore < firewall-config

Finally, you should permanently save the active configuration so that it will be loaded automatically when the system reboots:

# service iptables save

If desired, you can eventually convert this firewall-config file into a regular iptables script so that it becomes more easily recognizable and manageable

No comments: