iptables command syntax: selecting the table, chain, position
Now, on to the syntax of the iptables command.
Note that this post only deals with how to select the correct table and chain you want to act upon. The way to define a rule (what packets should be matched and what to do with them) will be explained later.
First: which table
Theoretically, the first argument to iptables should be the table it is asked to act upon. This is the -t option. If not specified, it is the filter table by default. All arguments between brackets are optional. All arguments between <...> are MANDATORY.
Hence the command:
iptables -A OUTPUT blah blah
is the equivalent of:
iptables -t filter -A OUTPUT blah blah
If you want to act on ANOTHER table than filter (say, nat), then the -t argument becomes MANDATORY.
Second: how to act on the table
What to do on the table is determined by the following option. This can be: