114
If the devices in a network cannot synchronize to an authoritative time source, you can perform the
following tasks:
•
Select a device that has a relatively accurate clock from the network.
•
Use the local clock of the device as the reference clock to synchronize other devices in the
network.
Use the command with caution to avoid time errors. As a best practice, adjust the local system time
to a correct value before you execute the command.
Examples
# Specify the local clock as the reference source, with the stratum level 2.
<Sysname> system-view
[Sysname] ntp-service refclock-master 2
ntp-service reliable authentication-keyid
Use
ntp-service reliable authentication-keyid
to specify the created authentication key as a
trusted key.
Use
undo
ntp-service reliable authentication-keyid
to remove the configuration.
Syntax
ntp-service reliable authentication-keyid
keyid
undo ntp-service reliable authentication-keyid
keyid
Default
No trust key is specified.
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
keyid
: Specifies an authentication key number in the range of 1 to 4294967295.
Usage guidelines
When NTP authentication is enabled, a client can be synchronized only to a server that can provide
a trusted authentication key.
Before you use the command, make sure NTP authentication is enabled and an authentication key is
configured. The key automatically changes to untrusted after you delete the key. In this case, you do
not need to execute the
undo ntp-service reliable authentication-keyid
command.
You can set a maximum of 128 keys by executing the command.
Examples
# Enable NTP authentication, specify the MD5 algorithm, with the key ID of 37 and key value of
BetterKey
.
<Sysname> system-view
[Sysname] ntp-service authentication enable
[Sysname] ntp-service authentication-keyid 37 authentication-mode md5 BetterKey
# Specify this key as a trusted key.
[Sysname] ntp-service reliable authentication-keyid 37