Desertbum
Posts: 2
Joined: Sun Sep 23, 2012 4:30 pm
Location: Bavaria (that's near Germany)

Time synchronization

Sun Sep 23, 2012 4:42 pm

Hello all,
this is my first post. I try to set up my pi but have problems with the setting time.
As I understand ntp is running "out of the box".
However my pi does not connect to a NTP-server.

Here my ntp-conf (unchanged):

Code: Select all

# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift


# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable


# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example

# pool.ntp.org maps to about 1000 low-stratum NTP servers.  Your server will
# pick a different set every time it starts up.  Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst


# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details.  The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust

# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255

# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines.  Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient


When I use ntpq to check which server is contacted I get only my router :

Code: Select all

ntpq -p

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Time synchronization

Sun Sep 23, 2012 6:38 pm

Do you have a working internet connection ?. The NTP just works usually.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

Desertbum
Posts: 2
Joined: Sun Sep 23, 2012 4:30 pm
Location: Bavaria (that's near Germany)

Re: Time synchronization

Sun Sep 23, 2012 8:43 pm

...sorry I did not finish my first post (newbee :oops: )

When I check with

Code: Select all

ntpq -p
I only get my router

Code: Select all

    remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 fritz.box       .INIT.          16 u    -   64    0    0.000    0.000   0.000
But for installing programs and updates I have perfect internet connection.
My thought was a mistake in the ntp.conf.

Can you help?

Desertbum

LBS
Posts: 4
Joined: Mon Jan 28, 2013 3:53 pm

Re: Time synchronization

Thu Jan 31, 2013 8:35 am

I had the same problem. The syslog indicated problems with the 'restrict' lines in ntp.conf, so I tried without;
# Local users may interrogate the ntp server more closely.
#restrict 127.0.0.1
#restrict ::1
/> service ntp restart

Problem solved

Return to “Beginners”