1-23
As shown above, Switch A has been synchronized to Switch C, and the clock stratum level of Switch A
is 3, while that of Switch C is 2.
# View the NTP session information of Switch A, which shows that an association has been set up
between Switch A and Switch C.
[SwitchA-Vlan-interface3] display ntp-service sessions
source reference stra reach poll now offset delay disper
**************************************************************************
[1234] 3.0.1.31 127.127.1.0 2 255 64 26 -16.0 40.0 16.6
note: 1 source(master),2 source(peer),3 selected,4 candidate,5 configured
Total associations : 1
Configuring NTP Client/Server Mode with Authentication
Network requirements
z The local clock of Switch A is to be used as the master clock, with a stratum level of 2.
z Switch B works in the client mode and Switch A is to be used as the NTP server of Switch B, with
Switch B as the client.
z NTP authentication is to be enabled on both Switch A and Switch B.
Figure 1-11 Network diagram for configuration of NTP client/server mode with authentication
Configuration procedure
Configuration on Switch B:
# Enable NTP authentication on Switch B.
<SwitchB> system-view
[SwitchB] ntp-service authentication enable
# Set an authentication key.
[SwitchB] ntp-service authentication-keyid 42 authentication-mode md5 aNiceKey
# Specify the key as a trusted key.
[SwitchB] ntp-service reliable authentication-keyid 42
# Specify Switch A as the NTP server.
[SwitchB] ntp-service unicast-server 1.0.1.11 authentication-keyid 42
Before Switch B can synchronize its clock to that of Switch A, you need to enable NTP authentication for
Switch A.
Perform the following configuration on Switch A:
# Enable NTP authentication.
[SwitchA] ntp-service authentication enable
# Set an authentication key.