You are not logged in.

#1 2014-03-20 17:23:45

moose jaw
Member
From: Milwaukee
Registered: 2007-08-20
Posts: 104

[SOLVED] ntp not syncing

I have a new Arch install on which all is working just fine, but I'm having a problem with ntp. I have followed the instructions in the wiki, but I cannot get ntp to sync with remote servers. I have tried altering my iptables rules (and disabling the firewall altogether), but still no luck with ntp. This leads me to believe it's some other kind of issue. Here are a few pertinent details:

my /etc/ntp.conf:

# Associate to public NTP pool servers; see http://www.pool.ntp.org/
server 0.us.pool.ntp.org iburst
server 1.us.pool.ntp.org iburst
server 2.us.pool.ntp.org iburst
server 3.us.pool.ntp.org iburst

# Only allow read-only access from localhost
#restrict default noquery nopeer
restrict default -4 nomodify nopeer noquery notrap
restrict default -6 nomodify nopeer noquery notrap
restrict 127.0.0.1
restrict ::1
restrict <my IP address> mask 255.255.255.0

# Location of drift file
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log

(ntp.drift and ntp.log are both owned by ntp)

output of ntpq -p:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 T-ARA.fawong.co .INIT.          16 u    - 1024    0    0.000    0.000   0.000
 ntp4.Housing.Be .INIT.          16 u    - 1024    0    0.000    0.000   0.000
 time.gac.edu    .INIT.          16 u    - 1024    0    0.000    0.000   0.000
 soft-sea-01.ser .INIT.          16 u    - 1024    0    0.000    0.000   0.000

output of ss -u -a:

State      Recv-Q Send-Q      Local Address:Port          Peer Address:Port   
UNCONN     0      0            <my IP address>:ntp                      *:*       
UNCONN     0      0               127.0.0.1:ntp                      *:*       
UNCONN     0      0                       *:ntp                      *:*       
UNCONN     0      0       fe80::7a2b:cbff:feb6:d2d4:ntp                     :::*       
UNCONN     0      0                     ::1:ntp                     :::*       
UNCONN     0      0                      :::ntp                     :::*       

output of timedatectl:

      Local time: Thu 2014-03-20 12:21:40 CDT
  Universal time: Thu 2014-03-20 17:21:40 UTC
        RTC time: Thu 2014-03-20 17:21:40
        Timezone: US/Central (CDT, -0500)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2014-03-09 01:59:59 CST
                  Sun 2014-03-09 03:00:00 CDT
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2014-11-02 01:59:59 CDT
                  Sun 2014-11-02 01:00:00 CST

I am disinclined to believe it's a problem with my university's network/firewall, as ntp was working just fine on my previous Debian install on the same machine.

Thoughts? Any help much appreciated!

Last edited by moose jaw (2014-03-21 17:22:07)

Offline

#2 2014-03-20 18:23:55

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,354

Re: [SOLVED] ntp not syncing

What are the output of sysstat and sysinfo from inside the ntpdc command?

ewaller$@$odin ~ 1003 %ntpdc
ntpdc> sysstat
time since restart:     309685
time since reset:       309685
packets received:       766
packets processed:      749
current version:        749
previous version:       0
declined:               0
access denied:          0
bad length or format:   0
bad authentication:     0
rate exceeded:          0
ntpdc> sysinfo
system peer:          nbg1.shellvatore.us
system peer mode:     client
leap indicator:       00
stratum:              3
precision:            -20
root distance:        0.08078 s
root dispersion:      0.08627 s
reference ID:         [208.68.36.196]
reference time:       d6d5ac99.caaf397e  Thu, Mar 20 2014 11:06:17.791
system flags:         auth monitor ntp kernel stats
jitter:               0.000000 s
stability:            0.000 ppm
broadcastdelay:       0.000000 s
authdelay:            0.000000 s
ntpdc> q
ewaller$@$odin ~ 1004 %

Also, Why did you allow your IP address access in addition to local host?  Is the mask you provided correct for your university network?
And, I think (but I am not sure) the restrict all addresses with nopeer and no modify is redundant.

Edit:  My ntp.conf:

ewaller$@$odin ~ 1004 %cat /etc/ntp.conf
# With the default settings below, ntpd will only synchronize your clock.
#
# For details, see:
# - the ntp.conf man page
# - http://support.ntp.org/bin/view/Support/GettingStarted
# - https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon

# Associate to public NTP pool servers; see http://www.pool.ntp.org/
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org

# Only allow read-only access from localhost
restrict default noquery nopeer
restrict 127.0.0.1
restrict ::1

# Location of drift file
driftfile /var/lib/ntp/ntp.drift
ewaller$@$odin ~ 1005 %

Last edited by ewaller (2014-03-20 18:24:51)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2014-03-20 18:33:14

moose jaw
Member
From: Milwaukee
Registered: 2007-08-20
Posts: 104

Re: [SOLVED] ntp not syncing

Thanks! Here they are:

ntpdc> sysstat
sysstat
time since restart:     1523
time since reset:       1523
packets received:       9
packets processed:      0
current version:        0
previous version:       0
declined:               0
access denied:          0
bad length or format:   0
bad authentication:     0
rate exceeded:          0
ntpdc> sysinfo
sysinfo
system peer:          0.0.0.0
system peer mode:     unspec
leap indicator:       11
stratum:              16
precision:            -23
root distance:        0.00000 s
root dispersion:      0.02287 s
reference ID:         [73.78.73.84]
reference time:       00000000.00000000  Sun, Dec 31 1899 18:00:00.000
system flags:         auth monitor ntp kernel stats 
jitter:               0.000000 s
stability:            0.000 ppm
broadcastdelay:       0.000000 s
authdelay:            0.000000 s

I tried allowing my IP address alongside localhost in order to see whether it would make a difference (it didn't; the netmask is correct). Same with adding the other options you mentioned (I was copying from the default ntp.conf in my old Debian install). Switching the options back to the defaults distributed with Arch's ntp hasn't made a difference.

The line system peer mode: unspec strikes me as possibly useful. Or maybe it's just a symptom of whatever the underlying problem is?

Offline

#4 2014-03-20 18:38:39

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] ntp not syncing

The default ntp.conf shoudl work just fine.  It is recommended that you add the 'iburst' option to all the server lines, but even without that modification it should still work.  Of course, it does also help accuracy if you narrow down the ntp servers to country/region as you have already done.

Offline

#5 2014-03-20 21:23:46

moose jaw
Member
From: Milwaukee
Registered: 2007-08-20
Posts: 104

Re: [SOLVED] ntp not syncing

Yeah, changed the servers to 'us', included iburst, etc.

I am really stumped. My laptop (running Debian) has no problem doing ntp syncing here on campus. I tried doing a fresh install of ntp on an Arch box at home, with default config, and it works no problem. On my affected box here at work, I've tried recompiling ntp via abs and reinstalling, but ntp still refuses to work. I tried uninstalling all of Gnome (on the off chance that maybe something was introducing a conflict), but still ntp won't work. Maybe the next move is to reinstall Arch?

Offline

#6 2014-03-20 21:41:26

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,354

Re: [SOLVED] ntp not syncing

It looks like you are not reaching the servers.  Can you ping time.gac.edu? (I can)
If so, any chance you can capture some packets with a tool like wireshark?

Last edited by ewaller (2014-03-20 21:41:41)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2014-03-20 23:00:12

moose jaw
Member
From: Milwaukee
Registered: 2007-08-20
Posts: 104

Re: [SOLVED] ntp not syncing

Yes, I can ping time.gac.edu (w/zero packet loss, according to ping). I have fine network connectivity generally. Just something weird is going wrong with ntp...

Offline

#8 2014-03-21 17:24:22

moose jaw
Member
From: Milwaukee
Registered: 2007-08-20
Posts: 104

Re: [SOLVED] ntp not syncing

Turns out it's not an Arch-specific problem. I did a quick Debian install, booted from it, and had the same ntp problem from this machine. I could have sworn ntp was working on my previous Debian install, but I guess it had been a while since I checked on that. Anyway, marking as solved since it's clearly a local problem here. Thanks all for your thoughts and help, and sorry for the bother.

Offline

#9 2014-03-21 17:26:54

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] ntp not syncing

You should ask your school if they provide a time server.  Sometimes there is a time server located within the LAN of the given network.

Offline

#10 2014-03-21 20:58:30

moose jaw
Member
From: Milwaukee
Registered: 2007-08-20
Posts: 104

Re: [SOLVED] ntp not syncing

And, indeed, that is exactly the situation. Put my university's servers into ntp.conf and now all is well.

Offline

Board footer

Powered by FluxBB