2.9.3. Command Options for IPTables
18.104.22.168. Structure of IPTables Command Options
iptables commands have the following structure:
— Specifies which table the rule applies to. If omitted, the
filter table is used.
— Specifies the action to perform, such as appending or deleting a rule.
— Specifies the chain to edit, create, or delete.
pairs — Parameters and associated options that specify how to process a packet that matches the rule.
The length and complexity of an
iptables command can change significantly, based on its purpose.
For example, a command to remove a rule from a chain can be very short:
In contrast, a command that adds a rule which filters packets from a particular subnet using a variety of specific parameters and options can be rather long. When constructing
iptables commands, it is important to remember that some parameters and options require further parameters and options to construct a valid rule. This can produce a cascading effect, with the further parameters requiring yet more parameters. Until every parameter and option that requires another set of options is satisfied, the rule is not valid.
iptables -h to view a comprehensive list of
iptables command structures.