cisco交换机设置时区

2016-12-02

cisco交换机怎么设置时区?有网友提到自己不会设置思科的设备,该怎么办?小编在网上找了一些教程及命令,需要的朋友可以参考下。

###cisco交换机设置时区具体操作

Core-Switch-1#show clock

Core-Switch-1#show ntp status

Core-Switch-1#conf t

Core-Switch-1(config)# clock timezone GMT +8 此句命令则是设置时区命令了

Core-Switch-1(config)#service timestamps debug datetime msec localtime show-timezone

Core-Switch-1(config)#service timestamps log datetime msec localtime show-timezone

Core-Switch-1(config)#exit

Core-Switch-1# clock set 13:51:00 Sep 7 2011

或通过NTP服务器时间同步:

Core-Switch-1#ntp server 192.168.0.254 key 8888 注:8888是指ntp服务器的Key值

Core-Switch-1#wr

Core-Switch-1#sh log

下面以Cisco6509为例说明交换机时间同步的一些配置代码。

将CISCO6509配置为标准时间服务器

ntp server 192.168.0.101

查询当前的时间

Cisco6509#show clock

00:09:13.643 PDT Tue Jun 30 2009

配置一个北京时区,随意取名

clock timezone Beijing 8

再查询一下,已经同步过来了

CISCO6509#show clock

15:10:00.239 Beijing Tue Jun 30 2009

设定硬件时钟为权威NTPserver

(config)#clock calendar-valid

调整时间

#clock set 15:00:00 30 jun 2009

当前时钟为

#show clock

15:15:10.705 Beijing Tue Jun 30 2009

当前硬件时钟为

#show calendar

14:37:59 Beijing Tue Jun 30 2009

NTP源为vlan2

(config)#ntp source vlan 2

将同步其他时间去除

no ntp server 10.20.0.103

将硬件时钟与当前clock同步

#clock update-calendar

查看当前clock时间

#show clock

.15:47:57.558 Beijing Tue Jun 30 2009

查看当前硬件时钟

#show calendar

15:48:00 Beijing Tue Jun 30 2009

配置系统debug记录的时间格式

(config)#service timestamps debug datetime localtime

配置系统日志记录时间格式

(config)#service timestamps log datetime localtime

设置与其他时间服务器同步

(config)#ntp server 192.168.0.102

设置为第一级ntp服务器

(config)#ntp master 1

允许更新硬件时钟(不必须)

(config)#ntp update-calendar

查看的ntp设置的命令

sh clock detail

sh ntp sta

sh ntp ass

sh ntp ass detail

----配置命令

ntp authentication-key 1 md5 xx

ntp source Loopback0

ntp server 10.10.10.1 key 1

配置方法:

// router 7206

conf t

ntp source FastEthernet0/1 //指定更新源地址,覆盖ntp server中的配置

ntp update-calendar //设备如带有硬件时钟,同时更新硬件时钟

ntp server 202.155.248.218 source FastEthernet0/1 //指定更新目的地址,香港,并指定更新源接口为f0/1.

int f0/1

ntp enable

这时你应该已经获得了时间,但是注意,时区是否正确,默认为格林威治时间,如想改为北京时间,下面这步是必不可少的。来源:

clock timezone BeiJing 8 //最后这个数字8,代表+8时区 认

验证方法:

show ntp associate

以上内容来自互联网,希望对大家有所帮助。

更多相关阅读

最新发布的文章