如何更改 Cisco Catalyst 3750x 交换机上的日期

网络工程 思科 转变 交换 联网 顺式催化剂
2022-02-10 01:18:33

我们正在使用 cisco Catalyst 3750x 24 端口交换机系列

如何更改交换机上的确切日期(新加坡)

ASW-G-L09-001#show running-config
Building configuration...

Current configuration : 11883 bytes
!
! Last configuration change at 15:46:32 PST Wed May 18 2011 
!
version 15.2
no service pad
service timestamps debug datetime msec localtime
service timestamps log datetime msec localtime
service password-encryption
service sequence-numbers

aaa new-model
!
!
aaa authentication login default local
!
aaa session-id common
clock timezone PST 8 0
switch 1 provision ws-c3750x-24p
system mtu routing 1500
ip routing
!
2个回答

操作顺序很重要,因为先设置时间会导致发出区域命令后时间不正确,所以你需要做的是:

首先,您在configure terminal提示符处使用以下命令设置常规时区:

clock set timezone <standard zone> <offset>

例如:clock set timezone EST -5

然后,您可以使用以下提示设置夏令时时区configure terminal

clock summer-time <daylight-savings-zone> recurring

例如:clock summer-time EDT recurring

(如果您所在的国家/地区不使用夏令时,您可以使用 删除它no clock summer-time

最后,您从特权 exec 提示符设置时间和日期,使用:

clock set <hh:mm:ss> <Month> (in abbreviated format) <Day> <Year>

例如:clock set 10:05:45 Oct 07 2020

要将时钟设置为新加坡时间,请先设置时区。在配置模式下输入此命令:

router(config)# clock timezone SGT 8

然后您可以手动设置时钟(如@jessep 所示)或使用网络时间协议(NTP)从可靠来源获取正确时间。如果您的路由器可以访问 Internet,则可以使用公共 ntp 服务器。为了可靠性,您可以配置多个来源。这是一个使用来自sg.pool.ntp.org的两个来源的示例

router(config)# ntp server 51.79.156.52
router(config)# ntp server 210.23.25.77

要查看时间,请键入

show clock

要验证您的路由器是否与时间源同步,请键入

show ntp status