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.
    – B. Shea
    Dec 21, 2017 at 2:00
  • 1
    This fixed mine askubuntu.com/a/895300/169878
    – B. Shea
    Jan 18, 2018 at 4:28

3 Answers 3

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.

0

I got similar problem with ntpd [email protected] under OpenWrt 22.03.3

ntpdate works without problems, so this problem wasn't related with NTP servers or traffic routing and restrictions. In my case ntpd incorrectly binds to interfaces or process data from them. In other words ntpd sends packets, but can't get replies because of internal error. As a workaround you have to add to conf file:

interface listen ethX

Where ethX is the interface ntpd should listen answers from NTP servers

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Apr 24, 2023 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .