Moxa UC-8410A-T-LX [51/86] Defining a policy for chain rules

Moxa UC-8410A-T-LX [51/86] Defining a policy for chain rules
UC-8410A Series Linux Software General Debian Package Usage
5-11
Observing and Erasing Chain Rules
Usage:
# iptables [-t tables] [-L] [-n]
-t tables: Table to manipulate (default: ‘filter’); example: nat or filter.
-L [chain]: List all rules in selected chains. If no chain is selected, all chains are listed.
-n: Numeric output of addresses and ports.
# iptables [-t tables] [-FXZ]
-F: Flush the selected chain (all the chains in the table if none is listed).
-X: Delete the specified user-defined chain.
-Z: Set the packet and byte counters in all chains to zero.
Examples:
# iptables -L -n
In this example, since we do not use the -t parameter, the system uses the default ‘filter’ table. Three chains
are included: INPUT, OUTPUT, and FORWARD. INPUT chains are accepted automatically, and all connections
are accepted without being filtered.
#iptables –F
#iptables –X
#iptables -Z
Defining a Policy for Chain Rules
Usage:
# iptables [-t tables] [-P] [INPUT, OUTPUT, FORWARD, PREROUTING, OUTPUT, POSTROUTING]
[ACCEPT, DROP]
-P: Set the policy for the chain to the given target.
INPUT: For packets coming into the UC-8410A-LX series.
OUTPUT: For locally-generated packets.
FORWARD: For packets routed out through the UC-8410A-LX series.
PREROUTING: To alter packets as soon as they come in.
POSTROUTING: To alter packets as they are about to be sent out.
Examples:
#iptables –P INPUT DROP
#iptables –P OUTPUT ACCEPT
#iptables –P FORWARD ACCEPT
# modprobe iptable_nat
#iptables –t nat –P PREROUTING ACCEPT
#iptables –t nat –P OUTPUT ACCEPT
#iptables -t nat –P POSTROUTING ACCEPT
In this example, the policy accepts outgoing packets and denies incoming packets.

Содержание

Скачать