View previous topic :: View next topic |
Author |
Message |
number_nine Tux's lil' helper
Joined: 05 May 2005 Posts: 136
|
Posted: Mon Aug 22, 2005 5:08 am Post subject: computer won't sync to local ntpd server |
|
|
I've got a LAN with several computers; I'm trying to make one a local ntp server, and sync the rest to that one. I'm basically following the nice instructions at the Gentoo Wiki NTP Howto.
So my server's /etc/ntp.conf looks like this:
Code: |
restrict 127.0.0.1 nomodify
restrict 192.168.0.1 mask 255.255.255.0 nomodify nopeer notrap
server pool.ntp.org prefer
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 127.127.1.1
fudge 127.127.1.1 stratum 10
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntpd.log
|
And as far as I can tell, is working appropriately:
Code: |
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*c-24-130-207-18 .GPS. 1 u 976 1024 377 84.820 2.961 0.191
+Time2.Stupi.SE .PPS. 1 u 939 1024 377 133.455 2.438 0.429
-ima.cipsga.org. 132.246.168.164 3 u 953 1024 377 190.163 -2.016 0.306
+time.uswo.net 198.82.1.201 3 u 856 1024 377 54.576 0.012 0.193
LOCAL(1) LOCAL(1) 10 l 5 64 377 0.000 0.000 0.001
|
However, the local machines have an /etc/ntp.conf that looks like this:
Code: |
restrict 127.0.0.1 nomodify
restrict 192.168.0.1 mask 255.255.255.0 nomodify nopeer notrap
server septictank
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
|
("septictank" is the name of my local ntp server.)
And while the ntpd runs (without writing any errors to the system log), it doesn't actually sync time (my system clock will drift noticeably).
But I can't seem to pinpoint why it is not sync'ing. ntpq gives some clue:
Code: |
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
septictank.raw- 24.130.207.189 2 u 18 64 377 0.226 -5819.2 1101.62
|
Note that there is a space in front of the remote ntp server's name. According to the "Tally Codes" section of the NTPQ documentation, a space means "reject", and that "the peer is discarded as unreachable, synchronized to this server (synch loop) or outrageous synchronization distance."
But how do I determine which is the case? I know that the peer is reachable, as I can run ntpdate against my server (i.e. septictank). The sync distance should not be "outrageous" as this is on a local LAN. And the restrict lines in my config should prevent a sync loop.
So why won't it sync?!
Thanks for any hints or suggestions. |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Mon Aug 22, 2005 5:12 am Post subject: |
|
|
Addto ntp.conf on the server side, and make sure the restrict 127.0.0.1 line on the client side doesn't specify nomodify. That's basically the difference to the configuration at my place, and it syncs OK... _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
number_nine Tux's lil' helper
Joined: 05 May 2005 Posts: 136
|
Posted: Mon Aug 22, 2005 7:17 pm Post subject: |
|
|
moocha wrote: | Addto ntp.conf on the server side, and make sure the restrict 127.0.0.1 line on the client side doesn't specify nomodify. That's basically the difference to the configuration at my place, and it syncs OK... |
I made those changes, but unfortunately, it still doesn't sync.
Would you (or anyone else) mind posting your (working) ntp.conf files for your server and client(s)?
Thanks again! |
|
Back to top |
|
|
number_nine Tux's lil' helper
Joined: 05 May 2005 Posts: 136
|
Posted: Wed Aug 31, 2005 12:35 am Post subject: |
|
|
Well, I've been doing some playing around... Now I can't even get my computer to sync to the public NTP servers. Here's my /etc/ntp.conf:
Code: | restrict 127.0.0.1 nomodify
server pool.ntp.org prefer
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 127.127.1.1
fudge 127.127.1.1 stratum 10
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntpd.log |
So I run ntpdate, then start ntpd. I wait a while (maybe a few minutes), and then run ntpq:
Code: | ntpq> pe
remote refid st t when poll reach delay offset jitter
==============================================================================
frigg.interstro 138.195.130.71 3 u 21 128 377 124.592 -3950.7 1260.34
cteha.ulp.co.il 192.114.62.249 3 u 26 128 377 201.236 -4670.9 1715.95
Time4.Stupi.SE .PPS. 1 u 79 128 377 129.134 -1668.9 1996.01
Time1.Stupi.SE 193.10.7.246 2 u 21 128 377 128.697 -3962.7 1253.70
*LOCAL(1) LOCAL(1) 10 l 13 64 377 0.000 0.000 0.001
ntpq> assoc
ind assID status conf reach auth condition last_event cnt
===========================================================
1 57708 9014 yes yes none reject reachable 1
2 57709 9014 yes yes none reject reachable 1
3 57710 9014 yes yes none reject reachable 1
4 57711 9014 yes yes none reject reachable 1
5 57712 9614 yes yes none sys.peer reachable 1 |
From what I've read, it looks like ntpd won't sync with something with really high offset and/or jitter values like mine is showing. Why do I have such high values? Remember, I ran ntpdate immediately prior to starting ntpd.
I have a hunch that there is something wrong with either the computer's hardware clock, or maybe the system clock. If I don't get ntpd to sync up (which I cannot), I have to run ntpdate about twice a day to keep my clock from drifting too much---it runs entirely too fast. It will easily gain an hour in one day.
Any help more ideas?
Thanks! |
|
Back to top |
|
|
VinnieNZ Tux's lil' helper
Joined: 11 Mar 2004 Posts: 126 Location: New Zealand
|
Posted: Wed Aug 31, 2005 2:04 am Post subject: |
|
|
I was having a nightmare trying to get NTP to work on my network at home and then found a program called openntp which I switched to.
Now everything seems to work really well and my server clock sync's with the internet and my internal pc's sync with the server fine.
It's very simple to setup and use and for small networks seems to be pretty good - it doesn't have all the advanced features of NTP of course but if you can do without them then this is a pretty good alternative.
There's a howto on the gentoo-wiki site, but the program really is quite simple. |
|
Back to top |
|
|
number_nine Tux's lil' helper
Joined: 05 May 2005 Posts: 136
|
Posted: Wed Aug 31, 2005 8:06 pm Post subject: |
|
|
VinnieNZ wrote: | I was having a nightmare trying to get NTP to work on my network at home and then found a program called openntp which I switched to.
Now everything seems to work really well and my server clock sync's with the internet and my internal pc's sync with the server fine.
It's very simple to setup and use and for small networks seems to be pretty good - it doesn't have all the advanced features of NTP of course but if you can do without them then this is a pretty good alternative.
There's a howto on the gentoo-wiki site, but the program really is quite simple. |
Well, I got openntpd up and running. And as far as I can tell, it's working (there are log entries in the syslog that say NTP is adjusting the time).
Problem is, the time is still drifting forward! It as though openntpd isn't correcting "enough".
Has anyone else seen this?
Thanks again! |
|
Back to top |
|
|
|