2024年6月10日发(作者:)
cisco交换机设置时区
Core-Switch-1#showclock
Core-Switch-1#showntpstatus
Core-Switch-1#conft
Core-Switch-1(config)#clocktimezoneGMT+8此句命令则是设
置时区命令了
Core-Switch-
1(config)#servicetimestampsdebugdatetimemseclocaltimeshow-
timezone
Core-Switch-
1(config)#servicetimestampslogdatetimemseclocaltimeshow-
timezone
Core-Switch-1(config)#exit
Core-Switch-1#clockset13:51:00Sep72011
或通过NTP服务器时间同步:
Core-Switch-1#ntpserver192.168.0.254key8888注:8888是指
ntp服务器的Key值
Core-Switch-1#wr
Core-Switch-1#shlog
下面以Cisco6509为例说明交换机时间同步的一些配置代码。
将CISCO6509配置为标准时间服务器
ntpserver192.168.0.101
查询当前的时间
Cisco6509#showclock
00:09:13.643PDTTueJun302009
配置一个北京时区,随意取名
clocktimezoneBeijing8
再查询一下,已经同步过来了
CISCO6509#showclock
15:10:00.239BeijingTueJun302009
设定硬件时钟为权威NTPserver
(config)#clockcalendar-valid
调整时间
#clockset15:00:0030jun2009
当前时钟为
#showclock
15:15:10.705BeijingTueJun302009
当前硬件时钟为
#showcalendar
14:37:59BeijingTueJun302009
NTP源为vlan2
(config)#ntpsourcevlan2
将同步其他时间去除
nontpserver10.20.0.103
将硬件时钟与当前clock同步
#clockupdate-calendar
查看当前clock时间
#showclock
.15:47:57.558BeijingTueJun302009
查看当前硬件时钟
#showcalendar
15:48:00BeijingTueJun302009
配置系统debug记录的时间格式
(config)#servicetimestampsdebugdatetimelocaltime
配置系统日志记录时间格式
(config)#servicetimestampslogdatetimelocaltime
设置与其他时间服务器同步
(config)#ntpserver192.168.0.102
设置为第一级ntp服务器
(config)#ntpmaster1
允许更新硬件时钟(不必须)
(config)#ntpupdate-calendar
查看的ntp设置的命令
shclockdetail
shntpsta
shntpass
shntpassdetail
----配置命令
ntpauthentication-key1md5xx
ntpsourceLoopback0
ntpserver10.10.10.1key1
配置方法:
//router7206
conft
ntpsourceFastEthernet0/1//指定更新源地址,覆盖ntpserver
中的配置
ntpupdate-calendar//设备如带有硬件时钟,同时更新硬件时钟
ntpserver202.155.248.218sourceFastEthernet0/1//指定更新
目的地址,香港,并指定更新源接口为f0/1.
intf0/1
ntpenable
这时你应该已经获得了时间,但是注意,时区是否正确,默认为
格林威治时间,如想改为北京时间,下面这步是必不可少的。来源:
clocktimezoneBeiJing8//最后这个数字8,代表+8时区认
验证方法:
showntpassociate
以上内容来自互联网,希望对大家有所帮助。
发布评论