华为交换机(S5720)配置日志外发syslog服务器

#指定发送消息基本,表示从0-7都发送

info-center source default channel 2 log level debugging

#指定从哪个接口发送

info-center loghost source Vlanif1

#指定远程syslog服务器ip

info-center loghost x.x.x.x

这个是我交换上的配置

info-center source default channel 2 log level debugging
info-center loghost source Vlanif15
info-center loghost 192.168.15.XX

--------------------------------------------------------------------------

服务器上配置

vim /etc/rsyslog.conf

#启用udp 514端口监听。

$ModLoad imudp

$UDPServerRun 514

#把来自两个交换机的日志分别放入到指定的log文件中。

:fromhost-ip,isequal, "x.x.x.x"              /var/log/switch01.log

:fromhost-ip,isequal, "x.x.x.x"              /var/log/switch02.log

#重启rsyslog服务

service rsyslog restart

如果是日志审计的话,直接在web页面添加syslog 就可以了。

---------------------------------------------------------------------------

原文地址:https://www.cnblogs.com/jingjiaming/p/15149022.html