
Configuring iptables and ip6tables
Using iptables and ip6tables Command Options 12-13
Using iptables and ip6tables Command Options
You can use the
-I
option or the
-R
option, instead of the
-A
option, to specify how a rule is added to the chain.
In the following example, the
-I
option specifies that to insert
the rule as the 11th rule in the
INPUT chain:
Examples
iptables -I INPUT 11 -s 10.240.10.240 -j DROP
iptables -I INPUT 11 -s fe80::220:edff:febe:3cae -j DROP
The rules that follow the new rule will be bumped up by 1.
In the following example, the -R option specifies that the rule is
to replace the 8th rule in the OUTPUT chain:
Example
iptables -R OUTPUT 8 -s 89.247.112.93 -j DROP
iptables -R OUTPUT 8 -s fe80::220:edff:febe:3cae -j DROP
You can specify the following values for the
-j
option:
You can specify
TCP, UDP, or ICMP as the value of the -p option.
-I Inserts the rule at a specified location before the end of
the chain.
-R Replaces a specific rule in the chain with the new rule.
ACCEPT The packet is allowed to pass through the specified chain (for
example, INPUT or OUTPUT).
DENY The packet is not allowed to pass through the specified chain
(for example, INPUT or OUTPUT). A message indicating that
the LX is not accepting connections is sent back to the source
IP Address.
DROP The packet is not allowed to pass through the specified chain
(for example, INPUT or OUTPUT). A message is not sent back
to the source IP Address.
Comentarios a estos manuales