8

I'm running ntpd server in my ubuntu (10.04) machine. But it is always stays in the 'INIT' state as shown below.

lyra@ws07475:~$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 europium.canoni .INIT.          16 u    - 1024    0    0.000    0.000   0.000
 lyra@ws07475:~$ 

Of course, this means that it is not keeping time.

How can I start 'ntpd' server properly ? Please help.

2
  • None of the answers fixes this. It seems to be a upstream bug. If I stop ntp process. Let it sit for a time. Start it again, I show peers, but after a given amount of time it goes back to showing "INIT" (and my localhost only). My /etc/ntp.conf is default. Works then it slowly fails. – bshea Dec 21 '17 at 2:00
  • 1
    This fixed mine askubuntu.com/a/895300/169878 – bshea Jan 18 '18 at 4:28
5

Sometimes internet routers have problems passing through NTP traffic. The reason is that UDP is a bit more trickier to forward than TCP and sometimes the port is even used on the device itself for an NTP daemon.

In my case it was DD-WRT which blocked all of my NTP traffic. And as you might have noticed: NTP is not very good in saying that something went wrong. And especially not good in saying what went wrong. Here is the link to a thread about DD-WRT: https://superuser.com/questions/386240/allow-lan-clients-to-sync-time-through-dd-wrt

You can easily check if your Router is blocking NTP with the tool ntpdate (which is kind of a single use version of ntpd):

  • ntpdate pool.ntp.org - this call behaves like ntpd as long you run it as root and ntpd is not running at the same time. This command fails if your router blocks NTP
  • ntpdate -u pool.ntp.org - this call uses an unprivileged port, which much more likely works.

In case your router blocks NTP, what can you do?

Unfortunately, ntpd doesn't support any other way of communication than opening the port 123.

Fortunately, there are alternative implementations which use different ports:

I got good results with OpenNTPD, but in Forums people also recommended chrony

You can also setup just one OpenNTPD host and let all other machines in your network sync to this machine with their default NTP implementation.

2

You only seem to have one server in your /etc/ntp.conf file. I have:

server ntp.ubuntu.com
server 0.north-america.pool.ntp.org
server 1.north-america.pool.ntp.org
server 2.north-america.pool.ntp.org
server 3.north-america.pool.ntp.org

It would probably be a good idea to add at least a couple more.

However, I can reach europium.canonical.com (the first one), therefore I suspect that the problem is communication between remote sites and the ntp port (123). Firewalls can affect this, as can NAT translation.

Please check any firewall you might run, and consider setting up your nat (assuming you are running nat) to forward packets directed to port 123 to your server.

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.