Iptables Commands

From WebHostingNeeds.com
Jump to: navigation, search

To save your active rules execute the following:

# /etc/init.d/iptables save

When you start iptables, the rules are read from '/etc/sysconfig/iptables':

# /etc/init.d/iptables start

And when you stop iptables, all rules are flushed:

# /etc/init.d/iptables stop

Save the rules to a file

# iptables-save > /root/iptables-save.out

Restore the rules

# iptables-restore -c /root/iptables-save.out


iptables