华三H3C交换机配置NTP时钟步骤 示例
现场1台H3C 5110交换机
版本:Comware Software, Version 5.20.99, Release 1105
当前没有指定NTP,
<H3C-5110>dis ntp-service status Clock status: unsynchronizedClock stratum: 16Reference clock ID: noneNominal frequency: 100.0000 HzActual frequency: 100.0000 HzClock precision: 2^18Clock offset: 0.0000 msRoot delay: 0.00 msRoot dispersion: 0.00 msPeer dispersion: 0.00 msReference 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: synchronizedClock stratum: 4Reference clock ID: 10.248.1.200Nominal frequency: 100.0000 HzActual frequency: 100.0000 HzClock precision: 2^18Clock offset: 0.0000 msRoot delay: 427.93 msRoot dispersion: 0.11 msPeer dispersion: 89.86 msReference 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