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.
|