Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 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 defining setting your nat (assuming you are running nat) to forward packets directed to port 123 to your server.

share|improve this answer

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

In my case it was a 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 links to a thread about DD-WRT: http://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 du?

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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