Red Hat LINUX 7.2 - OFFICIAL LINUX CUSTOMIZATION GUIDE Guida di Installazione Pagina 170

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 282
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 169
170 Chapter 14. Firewalling with iptables
The iptables commands are:
-A Appends the iptables rule to the end of the specified chain. This is the command used to
simply add a rule when rule order in the chain does not matter.
-C Checks a particular rule before adding it to the user-specified chain. This command can
help you construct complicated iptables rules by prompting you for additional parameters and
options.
-D Deletes a rule in a particular chain by number (such as 5 for the fifth rule in a chain). You
can also type the entire rule, and iptables will delete the rule in the chain that matches it.
-E Renames a user-defined chain. This does not affect the structure of the table at all. Rather, it
just saves you the trouble of deleting the chain, creating it under the new name, and reconfiguring
all of your rules for that chain.
-F — Flushes the selected chain, which effectively deletes every rule in the the chain. If no chain
is specified, this command flushes every rule from every chain.
-h Provides a list of helpful command structures, as well as a quick summary of command
parameters and options.
-I Inserts a rule in a chain at a particular point. Assign a number to the rule to be inserted and
iptables will put it there. If no number is specified, iptables will place your command at the
top of the rule list.
Caution
Be aware of which option (-A or -I) you are using when adding a rule. The order of the rules can
be very important when determining if a particular packet applies to one rule or another. Make
sure when adding a rule to the beginning or end of the chain that it does not affect other rules in
that chain.
-L — Lists all of the rules in the chain specified after the command. To list all rules in all chains in
the default filter table, do not specify a chain or table. Otherwise, the following syntax should
be used to list the rules in a specific chain in a particular table:
iptables -L chain-name -t table-name
Powerful options for the -L command that provide rule numbers and allow more verbose rule
descriptions, among others, are described in Section 14.3.7.
-N — Creates a new chain with a user-specified name.
-P Sets the default policy for a particular chain, so that when packets traverse an entire chain
without matching a rule, they will be sent on to a particular target, such as ACCEPT or DROP.
-R — Replaces a rule in a particular chain. You must use a rule’s number after the chain’s name to
replace that rule. The first rule in a chain relates to rule number 1.
-X — Deletes a user-specified chain. Deleting a built-in chain for any table is not allowed.
-Z — Zeros the byte and packet counters in all chains for a particular table.
14.3.4. Parameters
Once certain iptables commands are specified, including those used to add, append, delete, insert,
or replace rules within a particular chain, parameters are required to begin the construction of the
packet filtering rule.
-c — Resets the counters for a particular rule. This parameter accepts the PKTS and BYTES options
to specify what counter to reset.
Vedere la pagina 169
1 2 ... 165 166 167 168 169 170 171 172 173 174 175 ... 281 282

Commenti su questo manuale

Nessun commento