从内核 3.9.0 开始如何记录 iptables?

从内核 3.9.0 开始如何记录 iptables?

从内核 3.9.0 开始,记录 iptables 的正确方法是什么?

我无法再附加日志记录规则,例如:

# iptables --new-chain droplog
# iptables --append droplog --jump LOG --log-level info
iptables: No chain/target/match by that name.

我曾经通过检查以下内容来启用 IP 表日志记录支持:

IP: Netfilter Configuration  --->
 <*> IP tables support (required for filtering/masq/NAT)
    <*> LOG target support

但这个选项在内核 3.9.0 中缺失了,似乎已被CONFIG_NETFILTER_NETLINK_LOG.

答案1

启用目标的符号LOG已更改为NETFILTER_XT_TARGET_LOG。其位置也已移至:

Networking support
 Networking options
  Network packet filtering framework (Netfilter)
   Core Netfilter Configuration
    Netfilter Xtables support (required for ip_tables)
     LOG target support

如果我们能够跟踪内核符号如何随时间变化,那就太好了。

相关内容