1,netfilter iptables 

2,四个规则表 raw表 mangle表 nat表 filter表

3,五中规则链prerouting postrouting input output forward

4,规则链之间的顺序

 入站:prerouting --> input

 出站:output --> postrouting

 转发:prerouting --> forfard --> postrouting

iptables -t filter -I INPUT -p icmp -j REJECT

      表名      -I插入 -nL查看 链名     条件    操作ACCEPT DROP

iptables -L 查看表 一般搭配 -n速度更快 iptables -nL

      -A追加策略,从最后一行添加,-I是从第一行加。我觉得-A使用的多

iptables -F清空所有策略,但是不能清空默认策略

      -P设置默认规则 + DROP & ACCEPT

      -D INPUT 4 删除表filter INPUT 的第三行策略。

      -p后面接 -dport 80 端口号限制。

iptables -A INPUT -s 192.168.4.120 -j DROP

Linux和三层交换一样,有个路由转发功能需要开启。/etc/sysctl.conf 文件控制 sysctl -p刷新这个文件