iptablesrocks.org - an iptables guide & tutorial
Syntax & Structure

 

The iptables manual page is the best resource for learning all of the possible syntax options for iptables:

iptables man page

An iptables syntax quick reference


Taking a look at what you have

iptables -L [chain] - Lists your current iptables configuration

Making modifications

iptables -A [chain] - Append a rule to a desired chain in the current configuration

iptables -D [chain] - Delete a rule from a desired chain in the current configuration

iptables -R [chain] - Replace an existing rule from a desired chain in the current configuration

iptables - I [chain] - (that's a capital I as in Insert) Insert a new rule into a desired chain of the current configuration

iptables -N [chain] - Create a new chain

iptables -X [chain] - Delete a chain

Getting rid of all rules and starting over

iptable -X - Delete all chains

iptables -F - Flush the table of all contents

Importing & Exporting

iptables-save > filename - exports the current iptables configuration to a flat file.

iptables-restore < filename - imports an iptables configuration from a flat file and overwrites the current configuration.

 

 

More syntax & structure information coming soon!

 

 
contact iptablesrocks.org
modified
Site last modified: October 25, 2005 09:20:01
 
The Rocks Project