根据你的描述“勾选快速日志-会话记录”,防火墙很可能开启了所有会话的详细记录。默认情况下,会话日志包含非常丰富的信息:时间戳、源/目标IP、源/目标端口、协议、接口、会话ID、传输的字节数/包数、创建时间、结束时间、原因等等。每小时10GB的日志量,说明网络流量非常繁忙,每秒可能有成千上万的会话被创建和销毁,每条会话都输出一条完整的日志,累积起来就是海量数据。
H3C防火墙的会话日志输出可以通过customlog format命令自定义格式。以下是分步配置方案:
默认的会话日志格式包含所有字段,你需要创建一个自定义格式,只包含你需要的字段。
include 命令可以多次使用,指定需要输出的字段。目前我们只添加了源IP和目标IP。如果你还需要协议类型、端口等信息,可以类似添加 include protocol、include source-port 等。将刚才创建的自定义格式应用到日志输出中,并指定日志服务器。
customlog format session 命令后面直接跟 custom-format 参数,表示使用自定义格式输出会话日志。默认情况下,你开启了 session log flow-begin 和 session log flow-end,这意味着每个会话在创建和删除时都会各记录一条日志,日志量会翻倍。如果只关心会话的存在,可以考虑只记录会话创建日志。
flow-begin,保留 flow-end。如果你只在特定接口、特定方向(如入方向)需要记录会话日志,可以检查接口下的配置。通常你可能有类似这样的配置:
undo session log enable ipv4 inbound 关闭。完成上述配置后,发送到日志服务器的会话日志将只包含你指定的字段(如源IP和目标IP),格式类似于:
# info-center logbuffer module CFGLOG size 1024 info-center logfile module CFGLOG size-quota 10 info-center logfile module CFGLOG alarm-threshold 90 info-center security-logfile enable # customlog format session customlog host 192.168.30.2 export session customlog host source Vlan-interface30 customlog timestamp localtime customlog character-encoding utf-8 security syslog rate-limit 5000 # userlog flow export version 3
<F1070> system-view [F1070] customlog format session custom-format session-custom [F1070-custom-format-session-custom] include source-ip-address [F1070-custom-format-session-custom] include destination-ip-address [F1070-custom-format-session-custom] quit说明 这个防火墙输入不了,只能[FW-F1070]custom format session 后面就不能输入
# info-center logbuffer module CFGLOG size 1024 info-center logfile module CFGLOG size-quota 10 info-center logfile module CFGLOG alarm-threshold 90 info-center security-logfile enable # customlog format session customlog host 192.168.30.2 export session customlog host source Vlan-interface30 customlog timestamp localtime customlog character-encoding utf-8 security syslog rate-limit 5000 # userlog flow export version 3
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明