大网数据广告活动
服务器运维问答

Logging all packets in firewalld

· 52CE 我爱测

We're trying to configure firewalld to log all incoming packets. So far I've only managed to log only rejected packets with LogDenied=off that shows: FINAL_REJECT: IN=eth0 OUT= MAC=00:dd:3a:26:18:2d:dd:34:5f:78:9a:bc:ff:00 SRC=65…

问题原文

原帖链接 · Pat · CC BY-SA 3.0

We're trying to configure firewalld to log all incoming packets. So far I've only managed to log only rejected packets with LogDenied=off that shows:

 FINAL_REJECT: IN=eth0 OUT= MAC=00:dd:3a:26:18:2d:dd:34:5f:78:9a:bc:ff:00 SRC=65.13.35.231 DST=10.0.1.5 LEN=48 TOS=0x00 PREC=0x00 TTL=102 ID=31984 DF PROTO=TCP SPT=49886 DPT=3385 WINDOW=8192 RES=0x00 SYN URGP=0

But I need to log accepted packets as well. Is there any option to do that?

已采纳解答

原帖链接 · Troy · CC BY-SA 4.0

You can tag any rule with a prefix to identify accepted rules:

firewall-cmd --add-rich-rule='rule family=ipv4 source address=10.20.0.0/16 port port=1234 protocol=tcp log prefix="MyTagHere " level=info accept'

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-03-01)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。