View and clear iptables rules

One iptables to view the basic syntax

iptables [-t tables] [-L] [-nv]
Options and parameters:
-t: followed by table, such as nat or filter, if omitted, the default filter is used
-L: List current table rules
-n: No reverse check of IP and HOSTNAME is performed, and the speed of displaying information is much faster.
-v: List more information, including the total number of packets passing through the rule, related network interfaces, etc.
 
Two iptables view applications
List the rules of filter table 3 chains
target: represents the operation performed, ACCEPT means release, REJECT means rejection, and DROP means discard.
prot: represents the data packet protocol used, mainly including TCP, UDP and ICMP3 data packet formats.
opt: extra option description.
source: Indicates which source IP this rule is restricted for.
destination: Indicates which destination this rule is restricted for.
 
Three iptable-save syntax
iptables-save [-t table]
Options and parameters:
-t: It can be output for some data tables, such as for NAT or Filter.
This command will fully list the rules of the firewall
 
Four iptable-save applications
List the rules of the filter table

 
Five clear iptables syntax
iptables [-t tables] [-FXZ]
Options and parameters:
-F: clear all rules made
-X: clear all user "custom" chains
-Z: reset all chain counts and traffic statistics to zero
 
Six  applications to clear iptables


 
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326393856&siteId=291194637