How does ntp.conf of the ntp server looks like ?

Hello,

I have a program which automatically generates ntp.conf.
Now my question is, if I have a normal linux pc, and I want this one to be the ntp server,
what does ntp.conf look like then ?

my clients have there
server xxx.xxx.xxx.xxx line in there /etc/ntp.conf,all
pointing to that server of mine,
I already tried to let that server (just the pc running ntpd) synchronize on 127.127.1.0 and
also on 127.0.0.1 in ntp.conf, and it synchronizes on that, but the other clients can't seem to synchronize on
that. NTPD just stops.

thanks.
LVL 2
themuppeteerAsked:
Who is Participating?
 
jlevieConnect With a Mentor Commented:
> So I guess I should install ntp-4.1.0-4 on the machines with Red Hat 7.0

Yep, but you should get the source rpm for ntp-4.1.0-4 and build your own copy for 7.0. Trying to use the binary rpm from 7.2 is not likely to work.
0
 
jlevieCommented:
What version of NTP is installed on the Linux box? The format of the ntp.conf changed when V4.x was released and different setups are necessary.
0
 
themuppeteerAuthor Commented:
hello jlevie,

the problem is solved.
The server ntp.conf now looks like this:

server 127.127.1.0 #local clock
fudge 127.127.1.0 stratum 10

server 127.0.0.1
driftfile /etc/ntp/drift
authenticate no

and the clients ntp.conf like this:

server xxx.xxx.xxx.xxx
driftfile /etc/ntp/drift
authenticate no

At first the client seemed to sync on its local clock, but when I removed those local clock lines it
syncs on the server. I don't really know what I did that made it work, but it works now and I'm happy :)

So they changed the format of ntp.conf  ? Well I won't have troubles with that because apperantly I have version 1.

file /usr/sbin/ntpd
gives me:
/usr/sbin/ntpd: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically linked (uses shared libs), stripped

Thanks for the reaction anyway!

Best regards,
themuppeteer
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
themuppeteerAuthor Commented:
hmm
apperantly it does not work as well as I hoped.

if A syncs with  B  and B sync on local host then it works.
But
if A syncs with B and B syncs with another ntp server, then A doesnt want to sync with B.

Do you happen to know why ?

0
 
themuppeteerAuthor Commented:
and now all of a sudden it is synchronized again without me changing a thing.
how bizar.

my actions were:

A->B and B-> local host    result : Worked

Change B->external and restart ntpd on B
result:  A stayed synchronized for a while but then all of a sudden wasn't synchronized anymore.

I restarted ntpd on A and after a long while A gets synchronized anyway.

Is my problem solved now ?
If A should at a certain moment not be able to sync anymore, will ntpd then stop or keep trying ? (and for how long?)

Is it a good idea to start NTPD with the -A option ?


thnx.
0
 
jlevieCommented:
So your NTP server is B, correct?

An NTP server is not going allow a client to sync against it unless the server is in sync with the timekeeper it is configured to use. My guess, from what you've described, is that your local master isn't always synced and is rejecting requests from the clients. you can use 'ntpq' on the master and the clinet to see what's happening, for example:

wilowisp> ntpq
ntpq> peers
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 10.1.0.254      0.0.0.0         16 u    -  256    0    0.000    0.000 4000.00
*192.168.0.125   204.154.192.254  3 u   93  512  377   20.378   21.064   4.830
 LOCAL(0)        LOCAL(0)        10 l   66   64  377    0.000    0.000   0.008
ntpq> associations
ind assID status  conf reach auth condition  last_event cnt
===========================================================
  1 61092  8000   yes   yes  none    reject
  2 61093  9614   yes   yes  none  sys.peer   reachable  1
  3 61094  9014   yes   yes  none    reject   reachable  1
ntpq>

Says that 10.1.0.254 is configured as a master but in't being used because it isn't reachable. And because there is a usable external master the default local clock is rejected.
0
 
themuppeteerAuthor Commented:
thanks for the info jlevie.
Yes my server is B.

In case of an ntpserver being unreachable all of a sudden,he will sync on local clock.Will he then also change from local clock again to the server if the server becomes available again after a while ?

May I put the same address in peer as in server ?

thnx
0
 
themuppeteerAuthor Commented:
I'm having the same problem again...

2 linux machines (A and B), a ntp server C

I want to let A sync to  B and then B to the external server C.

This doesnt work.

A does not want to sync to B, but B can sync to C.
and if B syncs to his local cock, then A can sync to B.

Any clues ?
0
 
jlevieCommented:
When B is synced to C what does the "peers" and "associations" check reveal on B & A?

What Linux is this? If it is rpm based 'rpm -q ntp' should tell us what version of ntpd is in use.
0
 
themuppeteerAuthor Commented:
Linux is Red Hat 7.0 , rpm -q ntp gives me ntp-4.0.99j-7

On B (who is synchronized)
*******************************************************************************
     remote           refid      st t when poll reach   delay   offset  jitter
=======================================================================
*exte. nic.lth.se      14 u   29   64  377    0.874   91.949  95.312
 LOCAL(0)        LOCAL(0)        10 l   27   64  377    0.000    0.000   0.004

and associations:


ntpq> associations
ind assID status  conf reach auth condition  last_event cnt
===========================================================
  1 49300  9614   yes   yes  none  sys.peer   reachable  1
  2 49301  9014   yes   yes  none    reject   reachable  1
*******************************************************************************

on A (who can't synchronize with B)
*******************************************************************************
ntpq> peers
     remote           refid      st t when poll reach   delay   offset  jitter
=======================================================================
 xxx.xxx.xxx.xxx 0.0.0.0         16 u   32   64    0    0.000    0.000 4000.00

(where xxx is ip of my server B)

ntpq> associations
ind assID status  conf reach auth condition  last_event cnt
===========================================================
  1 30780  8000   yes   yes  none    reject

*******************************************************************************


does this ring any bell ?
0
 
jlevieCommented:
With ntpd not running on A (service ntpd stop) what happens if you do an 'ntpdate xxx.xxx.xxx.xxx'?

I sort of remember some problems with the version of ntp distributed with 7.0 and that an errata update was released to fix them. Unfortunately, all of the errata collections for 7.0 seem to have disappeared. Also I can't remember if 4.0.99 used the current syntax in ntp.conf or if it used to older syntax.
0
 
themuppeteerAuthor Commented:
All I can find about the ntpd on red hat 7.0 is something about a security hole in it.

http://www.redhat.com/support/errata/archives/RHSA-2001-045.html

should I install the ntpd of a later version of red hat on my system ?

ntpdate gives:
24 Sep 08:35:22 ntpdate[8698]: adjust time server xxx.xxx.xxx.xxx offset -0.001951 sec


thnx
0
 
themuppeteerAuthor Commented:
As things start getting urgent, I'm gonna put the points to 500.
0
 
themuppeteerAuthor Commented:
I have news:

apperantly, when I use a machine with ntp-4.0.99j-7 Red Hat 7.0 as A ,
                                               and B has ntp-4.1.0-4 and Red Hat 7.2
I get the following: B syncs on the external server, A can't sync on B (like before)

when I turn these around, so A syncs with the external server and B syncs to A, then it does work.

So I guess I should install ntp-4.1.0-4 on the machines with Red Hat 7.0

I'll try that.
0
 
gheistCommented:
It takes some time for client to synch with server.
If this causes problem ntpdate [server] should be used.
0
 
themuppeteerAuthor Commented:
I've got it working. But I had to update the ntp on the 7.0 machines to ntp-4.1.0-4 .
Indeed, I had to build on the 7.0 machine.
Thanks jlevie for the help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.