Moxa V2401-CE [42/108] Observe and erase chain rules

Moxa V2401-CE [42/108] Observe and erase chain rules
V2401/2402 Series Linux User’s Manual Managing Communications
3-15
Observe and Erase Chain Rules
Usage:
# iptables [-t tables] [-L] [-n]
-t tables: Table to manipulate (default: ‘filter’); example: nat or filter.
-L [chain]: List 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
Define 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 V2401/2402-I-LX.
OUTPUT: For locally-generated packets.
FORWARD: For packets routed out through the V2401/2402-I-LX.
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
#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.

Содержание

Похожие устройства

Скачать