华三H3C交换机配置NTP时钟步骤 示例

发布于:2025-05-17 ⋅ 阅读:(11) ⋅ 点赞:(0)

现场1台H3C 5110交换机
版本:Comware Software, Version 5.20.99, Release 1105

当前没有指定NTP,

<H3C-5110>dis ntp-service status 
 Clock status: unsynchronized
 Clock stratum: 16
 Reference clock ID: none
 Nominal frequency: 100.0000 Hz
 Actual frequency: 100.0000 Hz
 Clock precision: 2^18
 Clock offset: 0.0000 ms
 Root delay: 0.00 ms
 Root dispersion: 0.00 ms
 Peer dispersion: 0.00 ms
 Reference time: 00:00:00.000 UTC Jan 1 1900(00000000.00000000)

以下是配置步骤
ntp server: 10.248.1.200

1 进入配置模式

<H3C-5110>sys
System View: return to User View with Ctrl+Z.

2 指定ntp server

[H3C-5110]ntp unicast-server 10.248.1.200 

3 配置完成,查看ntp状态

已经同步成功

[H3C-5110]dis ntp-service status 
 Clock status: synchronized
 Clock stratum: 4
 Reference clock ID: 10.248.1.200
 Nominal frequency: 100.0000 Hz
 Actual frequency: 100.0000 Hz
 Clock precision: 2^18
 Clock offset: 0.0000 ms
 Root delay: 427.93 ms
 Root dispersion: 0.11 ms
 Peer dispersion: 89.86 ms
 Reference time: 03:29:50.598 UTC May 15 2025(EBCFDE2E.99334C5D)

查看当前时间,不对,差了8小时,是因为时区没改,

要改为东8区

[H3C-5110]dis clock
03:29:56 UTC Thu 05/15/2025

[H3C-5110]clock timezone UTC add 8:00:00

修改后再次查看日期时间正常

[H3C-5110]dis clock
11:30:18 UTC Thu 05/15/2025
Time Zone : UTC add 08:00:00

如果没有NTP SERVER, 想要手工的指定日期时间,使用下面命令

注意:是在>模式,而不是配置模式

clock datetime 21:27:00 2025/5/1 

如果报错,说明需要先指定clock protocl为none
示例:

<H3C-5110>clock datetime 21:27:00 2025/5/1 
To manually set the system time, execute the clock protocol none command first.

[H3C-5110]clock protocol none
<H3C-5110>clock datetime 21:27:00 2025/5/1 

确认修改已经生效

[H3C-5110]dis clock
21:27:19.038 UTC Thu 05/01/2025

网站公告

今日签到

点亮在社区的每一天
去签到