iptables调试方法

iptables调试时,使用到raw表、ipt_LOG内核模块、日志记录在kern.log中。

具体的步骤如下:

1.准备ipt_LOG内核模块

  modprobe ipt_LOG

2.使用raw表,加入跟踪规则

  iptables -t raw -A PREROUTING -p icmp -j TRACE
  iptables -t raw -A OUTPUT -p icmp -j TRACE

raw表只能在PREROUTING和OUTPUT上加处理规则,符合规则的包会被跟踪,并输出到日志中。

3.查看日志

  tail -f /var/log/kern.log
posted @ 2014-10-15 15:39  drop *  阅读(2153)  评论(0编辑  收藏  举报