所有业务模块只发生警告级别日志
info-center source default channel 2 log level warning
把策略放行、策略拒绝、策略匹配等日志,专门发给后端 Syslog 日志服务器
info-center source POLICY channel 2
后面local-time本地时间
info-center loghost 21.12.2.21 local-time
info-center loghost 21.12.2.140 local-time
info-center loghost 21.122.17.165 local-time
时间精确至0.001s
info-center timestamp log short-date precision-time tenth-second
firewall log source 21.14.252.2 1024
firewall log host 1 21.12.2.21 514
firewall log host 2 21.12.2.140 514
firewall log host 3 21.122.17.165 514
同时发给所有日志主机
firewall log session multi-host-mode concurrent
日志通过syslog发送
firewall log session log-type syslog
上诉端口号不知是TCP还是UDP,需要帮忙翻译为华三防火墙的配置
你提到的端口号 514,在 H3C 防火墙中默认为 UDP 协议,无需在命令中额外指定。需要同时发送给多个日志服务器时,分别配置 info-center loghost 命令即可。
| 华为防火墙配置 | H3C 防火墙对应配置 | 说明 |
|---|---|---|
info-center source default channel 2 log level warning | info-center source default channel loghost log level warning | 设置全局默认日志级别。warning 会输出比它紧急的各级别日志。• 华三的默认输出路径是 loghost,不是数字 2。 |
info-center source POLICY channel 2 | info-center source FIREWALL channel loghost log level informational | 单独指定防火墙策略日志。华三中策略日志属于 FIREWALL 模块,其放行/拒绝对应 informational 级别。 |
info-center loghost [IP] local-time | info-center loghost [IP] local-time | 配置日志服务器及使用本地时间。华三命令完全兼容,只在 loghost 前加 info-center 前缀。 |
info-center timestamp log short-date precision-time tenth-second | info-center timestamp loghost date with-milliseconds | 配置日志时间戳精确到0.001秒(毫秒)。 |
firewall log source [IP] [number] | firewall log source [IP] [port] | 华三仅通过 nat log、flow-log 等模块配置日志源参数,无全局日志源命令。 |
firewall log host [ID] [IP] [PORT] | info-center loghost [IP] | 配置接收日志的后端服务器。 |
firewall log session multi-host-mode concurrent | (行为相同,无需配置) | 无等效命令行,但配置多个 info-center loghost 即可实现并发发送。 |
firewall log session log-type syslog | 需开启会话日志的Syslog输出 | 无全局 log-type 设置,需通过 customlog format session 和 info-center loghost 实现 Syslog 发送。 |
系统日志 vs 流量日志:info-center 发送的是设备本身的系统日志(Syslog)。如需要 NAT/会话流量日志,必须额外配置 customlog format session 或 flow-log host 等独立设置。
安全策略必须放行 LOCAL 域:H3C 防火墙必须放行 LOCAL 安全域到 Trust 的流量,否则日志无法传出。
配置生效验证:
display info-center:查看配置,确认 loghost 启用且日志级别非 Deny。
display logbuffer:检查设备本地缓存,看是否有新日志生成。
ping 日志服务器 IP:确认设备与服务器之间三层路由可达。
暂无评论
# 1、所有业务模块 默认只输出警告及以上级别
info-center source default channel 2 log level warning
# 2、单独放行 POLICY 策略模块 日志到channel 2
info-center source policy channel 2 log level informational
# 3、指定三台Syslog日志主机,携带本地时区时间
info-center loghost 21.12.2.21 local-time channel 2
info-center loghost 21.12.2.140 local-time channel 2
info-center loghost 21.122.17.165 local-time channel 2
# 4、时间戳:短日期 + 精确到毫秒(对应华为precision-time tenth-second 0.001s)
info-center timestamp log short-date precision-time millisecond
# 日志发送源IP 21.14.252.2
firewall log source ip 21.14.252.2
# 全局开启策略日志
firewall policy log enable
# 开启会话日志(上下线、会话创建销毁)
firewall session log enable
info-center loghost自动并发。firewall log session multi-host-mode concurrent华三不用单独配置,配置三台 loghost 就会同时并发推送。firewall log session log-type syslog华三向日志服务器发送天生就是 Syslog 报文,无需命令切换。info-center source default channel 2 log level warning
info-center source policy channel 2 log level informational
info-center loghost 21.12.2.21 local-time channel 2
info-center loghost 21.12.2.140 local-time channel 2
info-center loghost 21.122.17.165 local-time channel 2
info-center timestamp log short-date precision-time millisecond
firewall log source ip 21.14.252.2
firewall policy log enable
firewall session log enable
rule permit xxx xxx logging
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论