You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

RHEL8内核4.18配置iptables TRACE链无日志输出求助

RHEL8中iptables TRACE规则无法生成ICMP日志的问题

已完成的配置

我在RHEL8系统(内核版本4.18.0-477.13.1)中配置了raw表的TRACE规则,预期记录ICMP数据包的入站和出站日志:

# iptables -L -t raw
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         
TRACE      icmp --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
TRACE      icmp --  anywhere             anywhere            

随后执行了内核模块加载及参数配置:

# modprobe nf_log_ipv4
# sysctl -w net.netfilter.nf_log.2=nf_log_ipv4

同时加载了nf_log_syslog模块(该模块在RHEL8的4.18.x内核中替代旧的nf_log*或ipt_LOG模块):

# modprobe nf_log_syslog

问题现象

当ping一个经iptables NAT转换的IP地址时,dmesg -c输出和systemd.journald管理的syslog中均未出现TRACE日志信息。

对比测试:在Fedora-36(内核6.2.16)系统上完全重复上述步骤,TRACE日志能正常生成:

# iptables -t raw -A PREROUTING -p icmp -j TRACE
# iptables -t raw -A OUTPUT -p icmp -j TRACE
# modprobe nf_log_ipv4
# echo nf_log_ipv4 > /proc/sys/net/netfilter/nf_log/2

请问我遗漏了什么配置?


内容的提问来源于stack exchange,提问作者JVD

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.17 17:30:34