A S5700 switch is configured to synchronize with 3 NTP servers. In the logs it can be observed that the switch is frequently changing the NTP server and a big number of NTP/4/PEER_SELE logs are occupying the logbuffer memory.
Nov 7 2016 05:24:48+11:00DST S5700 %%01NTP/4/PEER_SELE(l):The peer selected by the system is xx.xx.65.254.
Nov 7 2016 03:26:33+11:00DST S5700 %%01NTP/4/PEER_SELE(l):The peer selected by the system is xx.xx.140.38.
Nov 7 2016 02:53:10+11:00DST S5700 %%01NTP/4/PEER_SELE(l):The peer selected by the system is xx.xx.129.130.
ntp-service source-interface Vlanif1
ntp-service unicast-server xx.xx.129.130 authentication-keyid 1
ntp-service unicast-server xx.xx.140.38 authentication-keyid 1
ntp-service unicast-server xx.xx.65.254 authentication-keyid 1
By default,in the unicast-server mode, the polling mechanism of the NTP client is sending a NTP message to each of the configured servers every 64 seconds. When the client receives the replies from the server, it will choose a peer depending on a number of factors(small, stratum, nearest, most accurate, delay) . In the situation where the replies received from the servers are similar, the switch needs to select only one server from which to synchronize its time. If its decision differs from the previous one, a log will be recorded in the log buffer.
In order to avoid the described situation, in the case where have multiple NTP servers, we would need to indicate one of the servers as the preferred one by making use of the “preference” parameter with the ntp-service unicast-server ip-address command . In this way, the NTP server will no longer be elected by chance and we will have a stable NTP service.
Format of the command :
ntp-service unicast-server ip-address [ version number | authentication-keyid key-id | source-interface interface-type interface-number | preference | vpn-instance vpn-instance-name | maxpoll max-number | minpollmin-number | burst | iburst | preempt | port port-number ] *
preference --Indicates the remote server as the preferred one. By
default, the remote server is not preferred.