日志服务器的监听端口为10514,交换机侧需要更改端口,但是部分交换机版本是V5,且小版本也比较低,不支持在info-center loghost x.x.x.x后跟port参数,有其他方式实现该需求吗?比如acl等等。
(0)
info-center loghost 命令后直接指定自定义端口(如10514)的问题,无法通过ACL来实现修改发送端口的需求。iptables 或 rsyslog 等工具,将收到的 514 端口报文重定向/转发到后端真正的日志服务器的 10514 端口。info-center loghost ? 查看完整的帮助提示。部分老版本可能需要使用特定的 facility 或其他组合参数来指定端口,但这属于罕见情况,若帮助文档中无 port 相关关键字,则确认为不支持。(0)
暂无评论
# 方式1(高版本V5)
info-center loghost 10.1.1.100 port 10514
# 方式2(进入loghost子视图配置)
info-center loghost 10.1.1.100
[H3C-info-center-loghost] port 10514
UDP 源随机 → 服务器IP:514,中间三层设备收到报文后,目的端口 514 转为 10514 再转发给日志服务器。# 1. 定义ACL匹配所有发往日志服务器514的syslog报文
acl number 3000
rule permit udp destination 192.168.1.200 0 eq 514
# 2. 全局配置目的端口映射(port-mapping,V5原生支持)
port-mapping application syslog port 514 protocol udp acl 3000
# 转换逻辑:匹配ACL的UDP514报文,目的端口替换为10514
port-mapping transform destination-port 10514
# 3. 确保三层转发、无ACL拦截UDP514
# 1. 监听UDP 10514,转发至本地514
iptables -A PREROUTING -t nat -p udp --dport 10514 -j REDIRECT --to-port 514
# 2. rsyslog同时监听514、10514双端口(更稳妥)
module(load="imudp")
input(type="imudp" port="514")
input(type="imudp" port="10514")
# 1. ACL匹配syslog日志流量
acl number 3000
rule permit udp destination 192.168.1.200 0 eq 514
# 2. 出接口配置目的NAT,改端口
interface Vlan-interface 100
nat outbound 3000 destination-port 514 to 10514
# 交换机日志基础配置不变
info-center enable
info-center loghost 192.168.1.200
info-center loghost 192.168.1.200 port 10514
port-mapping 或 NAT 才能端口转换。display port-mapping
display info-center
display info-center statistics
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论