Moxa DA-682A-C7-DPP-LX [41/108] Delete a user generated chain

Moxa DA-682A-C3-DPP-LX [41/108] Delete a user generated chain
DA-682A-DPP Linux Software Managing Communications
3-23
WARNING
The command
moxa@Moxa:~# iptables –F
will flush all iptables rulechains from the kernel, permanently
deleting the firewall and fully exposing the computer to the open Internet.
You should save any firewall rules you configure in a file that you can
use to convenient re-
load them, in the
event that they are flushed. Before flushing any rule chains, first make sure you have saved your configuration
in an independent file that may be
conveniently uploaded to Netfilter. The following command will save a
ll of
the current iptables rules to
/etc/sysconfig/iptables.save:
root@Moxa:~# iptables-save > /etc/sysconfig/iptables.save
Zero-out the packet and byte counters for a rule chain
Zeroing the counters is sometimes useful when monitoring firewall activity for analysis. When used in
combination with the list argument, the zero argument will give a precise measurement of the number of
packets that have been processed since the last measurement, for all chains, a given chain, or even a given
rule within a chain. The full command to flush rule chains is as follows:
Moxa:~# iptables –L –Z -n [chain [rulenum]]
Command Arguments:
-Z: Set the packet and byte counters to zero in all chains, for only a given chain, or only a rule in a chain
Delete a User-Generated Chain
This command deletes a specified user-defined chain.
Moxa:~# iptables –X [chain]
There must be no references to the chain in other chains or tables, and the chain must be empty, i.e. not
contain any rules. You must delete or replace any remaining referring rules before the chain can be deleted. If
no argument is given, this will attempt to delete every user defined chain in the table.
Writing Rulechains
In this section we show you how to write rules for a simple industrial network firewall. More complicated
firewallssuch as those serving public networks, or untrusted customersare beyond the scope of this
manual. For advanced firewall needs, Moxa recommends the use of the Shoreline Firewall, mentioned above.
Moxa:~# iptables [-t table] [-AI] [INPUT, OUTPUT, FORWARD] [-io interface] /
[-p tcp, udp, icmp, all] [-s IP/network] [--sport ports] [-d IP/network] /
[--dport ports] –j [ACCEPT. DROP]
-A: Append one or more rules to the end of the selected chain
-I: Insert one or more rules in the selected chain as the given rule number
-i: Identifies an interface which will received a packet
-o: Identifies an interface over which a packet will be sent
-p: Identifies the protocol to be filtered
-s: Identifies a source address (network name, host name, network IP address, or plain IP address)
--sport: Identifies the source port, or the port where the packet originated
-d: Identifies the destination address (network name, host name, NAT or IP address)
--dport: Identifies the destination port, or the port where the packet will terminate
-j: Jump target. Specifies the target of the rules; i.e., how to handle matched packets.
For example, ACCEPT the packet, DROP the packet, or LOG the packet.

Содержание

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

Скачать