Cnfan.net中国网络
IT网络技术专家
Cisco技术
 最新专题: CISCO路由器配置手册   Cisco IOS Cookbook 中文精简版   思科IOS技术专题   专题 | 分类 | 投稿 | 搜索
 Cisco技术首页 | 思科动态 | 路由与交换 | 配置实例 | 思科安全 | 思科产品 | 综合 | 思科存储 | NetFlow

Cisco IOS Cookbook 中文精简版第十八章日志

  • 2007-12-21 21:35:22  作者:NeoShi  来源:互联网  浏览次数:87  文字大小:【】【】【
简介:18.1. 启用本地路由器日志 提问 实现路由器 自身保存日志记录,而不仅仅是显示在终端上 回答 Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#l ...

关键字: Cisco IOS Cookbook 中文精简版 日志

18.1. 启用本地路由器日志

提问 实现路由器 自身保存日志记录,而不仅仅是显示在终端上

回答
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#logging buffered informational
Router(config)#end
Router#
注释 缺省日志记录为debugging级别,例子中为informational忽略掉了debug消息。禁用使用下面命令
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#no logging buffered
Router(config)#end
Router#
 
18.2. 设定日志记录大小
提问 改变路由器保存日志记录的大小
回答
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#logging buffered 16000
Router(config)#end
Router#
注释 要注意的是改变了大小后,原有的日志记录会被清除。
18.3. 清除路由器日志记录
提问 清除路由器日志记录
回答
Router#clear logging
Clear logging buffer [confirm]<enter>
Router#
注释 无
18.4. 发送日志到屏幕显示
提问 在终端屏幕实时显示日志记录
回答
启用
Router#terminal monitor
Router#
禁用
Router#terminal no monitor
Router#
注释 缺省情况下日志记录只会在console端显示,要在VTY会话显示就必须使用上述命令
18.5. 使用远端日志服务器
提问 发送日志记录到远端日志服务器
回答
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#logging 172.25.1.1
Router(config)#end
Router#
12.2(15)T后也可以使用下面命令格式
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#logging host 172.25.1.1
Router2(config)#end
Router2#
注释 在12.2(15)T后增加了一个特性可以使发送的记录中包含了主机名,下面这是原始的日志记录
Jul 15 20:35:07 172.25.1.100: Jul 15 20:35:07.499 EDT: %SYS-5-CONFIG_I: Configured from console by ijbrown on vty0 (172.25.1.1)
下面这个是使用特性后的记录
Jul 15 20:37:05 172.25.1.100: Router2: Jul 15 20:37:05.173 EDT: %SYS-5-CONFIG_I: Configured from console by ijbrown on vty0 (172.25.1.1)
配置方法:Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#logging origin-id hostname
Router2(config)#end
Router2#
[1] [2] [3]

  <欢迎投稿>  <论坛讨论>
 »相关文章  »论坛新贴
精彩文章 活动资讯 今日头条