Chinaunix首页 | 论坛 | 博客

qsh

  • 博客访问: 3945419
  • 博文数量: 1015
  • 博客积分: 15904
  • 博客等级: 上将
  • 技术积分: 8572
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-04 19:16
文章分类

全部博文(1015)

文章存档

2019年(1)

2017年(1)

2016年(19)

2015年(27)

2014年(30)

2013年(95)

2012年(199)

2011年(72)

2010年(109)

2009年(166)

2008年(296)

分类: 系统运维

2012-06-25 11:59:54

Ntp

ntp server 10.10.134.81

ntp server 10.1.1.11

clock timezone gmt 8

clock timezone utc +8

 

正确:

 

service timestamps debug uptime
service timestamps log uptime

 

使用上面的配置会出现26w5d这种格式的时间记录:

26w5d: %SW_MATM-4-MACFLAP_NOTIF: Host 0001.d7ad.99c5 in vlan 10 is flapping between port Gi0/10 and port Gi0/11
26w5d: %SW_MATM-4-MACFLAP_NOTIF: Host 0001.d7ad.99c5 in vlan 10 is flapping between port Gi0/11 and port Gi0/10
26w5d: %SW_MATM-4-MACFLAP_NOTIF: Host 0001.d7ad.99c5 in vlan 10 is flapping between port Gi0/11 and port Gi0/10

==============

把上面配置改为下面:

service timestamps debug datetime msec
service timestamps log datetime msec localtime

 

show log会出现时间记录:

Jun 25 12:05:56.620: %SYS-5-CONFIG_I: Configured from console by vty0 (10.10.172.112)
Jun 25 12:06:10.814: %SW_MATM-4-MACFLAP_NOTIF: Host 0001.d7ad.99c5 in vlan 10 is flapping between port Gi0/11 and port Gi0/10

 

加上下面配置:

ntp server 10.10.134.81

ntp server 10.1.1.11

clock timezone beijing 8

 

北京时间 - 国家授时中心标准时间

三、cisco 6509 交换机 NTP 客户端的配置:

service timestamps debug datetime localtime ;配置系统debug记录时间格式

service timestamps log datetime localtime ;配置系统日志记录时间格式

clock timezone GMT 8 ;配置时区

ntp peer 10.161.195.222

ntp calendar-update ;允许NTP定期更新calendar

调试命令:

sh clock detail

sh ntp sta

sh ntp ass

sh ntp ass detail

注意:6509本身有硬件时钟,可保存时间。

四、Cisco 6509 配置NTP

NTP (Network Time Protocol) 为路由器、交换机和工作站之间提供了一种时间同步的机制。时间同步了,

多台网络设备上的相关事件记录可以放在一起看,更为清晰,方便了分析较复杂的故障和安全事件等。

(1)本地时钟设置:

clock timezone Peking +8 ;定义时区

clock calendar-valid ;允许使用硬件calendar作为时钟源

clock set hh:mm:ss ; month year ;如clock set 14:02:30 10 December 2003

clock update-calendar ;更新硬件时钟

(2)ntp server

ntp calendar-update ;允许NTP定期更新calendar

ntp master 3 ;允许本机作为NTP协议的主时钟,精度级别3,供其它对等体同步用。

ntp source int vlan 7 ;设置ntp时钟原的端口或IP地址

(3)常用的调试命令有:

show ntp status

show ntp associations

阅读(2719) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~