iptables之语法初步

字体大小: 中小 标准 ->行高大小: 标准

Iptables指令可以划分为两个部份,一个是“Iptables指令参数”,另一个是“规则语法”。

Iptables的参数相当多,这并不代表需要记住所有的参数,实际使用的参数并不是太多,只需要记住几个特定的参数即可,而且Iptables的参数是有规则可循的。如下图所示:

Linux防火墙,Iptables

Linux防火墙,Iptables

例1:列出Filter表中的所有内容

iptables –t filter –L

Linux防火墙,Iptables

例2:将Filter表中的INPUT Chain内容显示出来

iptables –t filter –L INPUT

Linux防火墙,Iptables

Linux防火墙,Iptables

例3:将Filter表中所有内容清空

iptables –t filter –F

Linux防火墙,Iptables

例4:将规则加入到Filter表的INPUT Chain

iptables –t filter –A INPUT –p icmp –j ACCEPT

Linux防火墙,Iptables

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/65985.html