Solved

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

Posted on 2004-09-21
16
8,884 Views
Last Modified: 2013-12-23
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.
0
Comment
Question by:themuppeteer
  • 10
  • 5
16 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 12114986
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
 
LVL 2

Author Comment

by:themuppeteer
ID: 12120257
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
 
LVL 2

Author Comment

by:themuppeteer
ID: 12120414
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
 
LVL 2

Author Comment

by:themuppeteer
ID: 12120466
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
 
LVL 40

Expert Comment

by:jlevie
ID: 12124100
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
 
LVL 2

Author Comment

by:themuppeteer
ID: 12132158
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
 
LVL 2

Author Comment

by:themuppeteer
ID: 12133674
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
 
LVL 40

Expert Comment

by:jlevie
ID: 12133853
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 2

Author Comment

by:themuppeteer
ID: 12134326
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
 
LVL 40

Expert Comment

by:jlevie
ID: 12134791
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
 
LVL 2

Author Comment

by:themuppeteer
ID: 12140522
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
 
LVL 2

Author Comment

by:themuppeteer
ID: 12140761
As things start getting urgent, I'm gonna put the points to 500.
0
 
LVL 2

Author Comment

by:themuppeteer
ID: 12141264
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
 
LVL 40

Accepted Solution

by:
jlevie earned 500 total points
ID: 12142672
> 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
 
LVL 61

Expert Comment

by:gheist
ID: 12156015
It takes some time for client to synch with server.
If this causes problem ntpdate [server] should be used.
0
 
LVL 2

Author Comment

by:themuppeteer
ID: 12166928
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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SSL RA VPN 7 78
Replacing a switch in a 3com 5500 switch stack 2 45
SCCM And Branchcache Server 1 35
Tracking Down IP in VMware 41 48
What’s a web proxy server? A proxy server is a server that goes between clients and web servers, used in corporate to enforce corporate browsing policy and ensure security. Proxy servers are commonly used in three modes. A)    Forward proxy …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now