Moxa Technologies 331 User Manual Page 42

  • Download
  • Add to my manuals
  • Print
  • Page
    / 69
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 41
Moxa C Programmable RTU Controllers Managing Communications
4-8
Use the lsmod command to check if the ip_tables module has already been loaded in the Moxa RTU unit. Use
the modprobe command to insert and enable the module.
Use the following command to load the modules (iptable_filter, iptable_mangle, iptable_nat):
#modprobe iptable_filter
NOTE
IPTABLES plays the role
of packet filtering or NAT. Be careful
when setting up the IPTABLES rules. If the rules
are not correct, remote hosts that
are connected via a LAN or PPP may deny access. It is stro
ngly recommended
to use the serial co
nsole to set up the IPTABLES.
Click on the following links for more information about iptables.
http://www.linuxguruz.com/iptables/
http://www.netfilter.org/documentation/HOWTO//packet
-filtering-HOWTO.html
Since the IPTABLES command is very complex, illustrating the IPTABLES syntax is divided into three categories:
Observe and erase chain rules, Define policy rules, and Append or delete rules.
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 Moxa RTU.
OUTPUT: For locally-generated packets.
FORWARD: For packets routed out through the Moxa RTU.
PREROUTING: To alter packets as soon as they come in.
Page view 41
1 2 ... 37 38 39 40 41 42 43 44 45 46 47 ... 68 69

Comments to this Manuals

No comments