3

We have a private network that we wish to implement an NTP server inside. Both the NTP server and client have been configure like this. On the server running ntpstat gives me:

synchronised to local net at stratum 11 
   time correct to within 11 ms
   polling server every 1024 s

and running ntpq -p gives me:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*LOCAL(0)        .LOCL.          10 l   55   64  377    0.000    0.000   0.001

Unfortunately on a client PC, running ntpstat gives me:

unsynchronised
  time server re-starting
   polling server every 64 s

and running ntpq -p used to give me Name or service not known but after adding an entry to /etc/hosts with the server's IP and name it gives me:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 SERVER-IS2      .INIT.          16 u   49   64   16    0.214    2.679   0.789

Too bad even after this the time is still not synchronized and ntpstat keeps giving me the same message.

The network is completely isolated that we don't want to use external NTP server that our server gets its time from.

What I tried so far:

  1. Re-install the ntp package.
  2. Restart the ntpdservice.
  3. Rebooting.
  4. chkconfig ntpd on.

Any help is appreciated!

  • Please could you edit your question to provide the output of ps -ef | grep [n]tp on your server, and also the (uncommented) lines from your ntp.conf. Feel free to change the IP addresses if that's really necessary, but if you do so please ensure that you change them consistently (don't change 1.2.3.4 to 5.6.7.8 in one place and then 5.6.3.8 in another). – roaima Nov 15 '16 at 9:39
  • Please add to the post distribution, distribuition version, and name of the ntp package (if in Debian or Ubuntu, post the output of dpkg -l | grep ntp) – Rui F Ribeiro Nov 15 '16 at 9:42
  • Sorry folks, will add them shortly! :) – 3bdalla Nov 15 '16 at 9:47
  • There seems to be something wrong with the statrum level, I also will have to check... please post the /etc/ntp.conf file of both the client and the server. – Rui F Ribeiro Nov 15 '16 at 9:48
  • 1
    @RuiFRibeiro stratum 10 is normal for a local (free-running) time source, and stratum 16 on a client is used to indicate an unsynchronised connection. – roaima Nov 15 '16 at 10:15
1

Alright folks here is what happened:

The server has this configuration:

restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
logfile /var/log/ntp.log

server 127.127.1.0 #local clock
fudge  127.127.1.0 stratum 10

driftfile /var/lib/ntp/drift

restrict 127.0.0.1
restrict 10.2.0.0 mask 255.255.0.0 nomodify notrap

Actually this config file is a help from a friend who did some research on this. Perhaps some feedback would be good.

On the client side nothing should be done since the NTP settings is distributed with DHCP (option ntp-servers). Although I noticed one thing that If you added prefer next to the server address in /etc/ntp.conf it will speed the process of synchronizing the client with the server.

Now all we had to do is chkconfig ntpd on and NTP is ready to go, although the client takes about 2 - 3 minutes to fully synchronize with the server that when ntpstat gives you synchronized (?).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.