NTP: ntpdate to sync time between the PCs on a private network

Vishu asked:

I have two systems. One acts as Primary/Active and has Internet connection and gets time from NTP server. The second system is Secondary/Passive and has no connection to the external world.

Primary and Secondary are connected on a private network interface eth1. Primary has

  • IP: 169.254.10.10
  • Subnet: 255.255.255.248
  • Broadcast: 169.254.10.15

Secondary has

  • IP: 169.254.10.11
  • Subnet: 255.255.255.248
  • Broadcast: 169.254.10.15

Primary has the following ntp.conf Configuration

driftfile /var/lib/ntp/ntp.drift
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server 192.168.101.25
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict ::1
restrict 169.254.10.0 mask 255.255.255.248
broadcast 169.254.10.15
disable auth
broadcastclient

I sync time on Secondary with only ntpdate and do not run ntpd daemon on Secondary. on Secondary I run ntpdate -b -t 4 -p 4 -u 169.254.10.10 (Primary Interface IP) And Ntpd server is running on Primary with the above said configuration.

The time on Secondary is not updated and throws error ntpdate[3636]: no server suitable for synchronization found

Thanks

My answer:


ntpdate does not read the ntp.conf file.

To synchronize one-time, pass the IP address of the server on the command line:

ntpdate 169.254.10.10

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.