Problem Synchronizing Server Time with ntpd – Solutions

linuxntpntpd

I am trying to ntp sync one machine with another.
both runs Debian lenny, and I installed the ntp package in both.
I configured the server to synchronize with an external machine by putting

server IP.ADDRESS iburst

in it's /etc/ntp.conf file.

I configured the client to sync with the serve by putting only the server in /etc/ntp.conf of the client.

however, they do not seem to be synchronizing. ntpq shows that the state is INIT which – according to the docs – indicates that "The association has not yet synchronized for the first time"

# ntpq -n
ntpq> pe
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 10.99.84.134    .INIT.          16 u  665 1024    0    0.000    0.000   0.000

ntpq -> as shows 'reject' in the condition line:

# ntpq
ntpq> as

ind assID status  conf reach auth condition  last_event cnt
===========================================================
  1 40102  8000   yes   yes  none    reject

Any idea how to solve this?
(I would rather not use ntpdate).

Best Answer

Many distributions these days are configuring ntpd to restrict access. If restrict lines are present in your server's /etc/ntp.conf, only hosts/networks matching those lines will be permitted to connect to ntpd. You probably need to add additional restrict lines for the hosts or networks you want to allow to sync to your server. For example, to let the client you mentioned sync, add one of the following lines:

# allow just this host
restrict 10.99.84.134 nomodify notrap

# or allow the whole /24 segment
restrict 10.99.84.0 mask 255.255.255.0 nomodify notrap

After that, restart ntpd, and your clients should be able to sync.