为了方便监控交换机和路由器的工作状态,我们可以设置工作电脑作为日志服务器,随时查看网络设备的工作情况。我的电脑使用WIN7英文旗舰版,通过3CDaemon软件设置好syslog服务器。
思科日志服务器配置可参考以下命令:
R1#conf t
R1(config)#logging on
R1(config)#logging HOST 192.168.104.201 //日志服务器的IP地址
R1(config)#logging facilit y local0
//facility标识, RFC3164 规定的本地设备标识为 local0 - local7 ()
R1(config)#logging trap 6 //日志记录级别
R1(config)#logging trap ?可用"?"查看详细内容
R1 (config)#logging trap ?
<0-7> Logging severity level
alerts Immediate action needed (severity=1)
critical Critical conditions (severity=2)
debugging Debugging messages (severity=7)
emergencies System is unusable (severity=0)
errors Error conditions (severity=3)
informational Informational messages (severity=6)
notifications Normal but significant conditions (severity=5)
warnings Warning conditions (severity=4)
<cr>
R1(config)#logging source-interface Gi0/45 //日志发出用的源IP地址
R1(config)#service timestamps log datetime msec localtime show-timezone
//日志记录的时间戳设置,可根据需要具体配置
检验,查看
R1#sh logging
华为S3526交换机日志服务器配置可参考如下配置:
[dabaicai2#]info-center ?
console Setting of console configuration
enable Enable the infomation center
logbuffer Setting of log buffer configuration
loghost Setting of logging host configuration
monitor Setting of monitor configuration
snmp Setting of snmp configuration
source Informational source setting
timestamp Set the timestamp type of information
trapbuffer Setting of trap buffer configuration
[dabaicai2#]info-center loghost 192.168.104.201
[dabaicai2#]quit
<dabaicai2#>save
This will save the configuration in the flash memory.
The switch configurations will be written to flash.
Are you sure?[Y/N]
Before pressing ENTER you must choose 'YES' or 'NO'[Y/N]:y
Now saving current configuration to flash memory.
Please wait for a while...
Save current configuration to flash memory successfully.