LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-07-2007, 03:51 AM   #1
santhosh23
Member
 
Registered: Oct 2006
Posts: 40

Rep: Reputation: 15
NTP problem


Hi,
I am synchornize the clock with one of the public servers but nptd is failing to do so,not sure why is this happening.please help me out with this issue.

/etc/ntp.conf file
Sample File
logfile /var/log/ntpd
logconfig =all
#NTP Server
server otherntp.server.org # A stratum 1 server at server.org
server pool.ntp.org # A stratum 2 server at research.gov
restrict otherntp.server.org mask 255.255.255.255 nomodify notrap noquery
restrict pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 127.0.0.1




NTP daemon logs

7 Sep 13:27:01 ntpd[7298]: ntpd exiting on signal 15
7 Sep 13:27:01 ntpd[7298]: offset 0.000000 sec freq 0.000 ppm error 0.000001 poll 6
7 Sep 13:27:14 ntpd[7346]: system event 'event_restart' (0x01) status 'sync_alarm, sync_unspec, 1 event, event_unspec' (0xc010)



ntpq -p

remote refid st t when poll reach delay offset jitter
==============================================================================
hermes127.csd.n .INIT. 16 u - 64 0 0.000 0.000 0.000
194.77.75.99 .INIT. 16 u - 64 0 0.000 0.000 0.000





your response at the earliest is much appreciated.



Thanks,
Santhosh
 
Old 09-07-2007, 03:56 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
not sure to be honest, but i would remove those restrict lines for the servers you are going to. i only define restrict lines for systems which are able to reach the box... if you're firewalled from them, which i'd assume is very very likely by default, then there's no point in restricting them (AFAIK)
 
Old 09-07-2007, 07:39 AM   #3
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
I go along with acid kewpie and recommend you comment out the restrict lines. I have seen this configuration quite a lot recently and am not sure whether this is being propagated via one of the distros. ntp uses udp (as opposed to tcp) on port 53 so this should not pose a risk to you.
 
Old 09-07-2007, 08:06 AM   #4
Slick666
Member
 
Registered: Feb 2006
Distribution: Ubuntu 8.04; Debian Etch
Posts: 167

Rep: Reputation: 33
One other thing to keep in mind with NTP is you typically want at least three local servers to sync with. This is to take into account of a different between two servers. if for sime reason one of the servers becomes out of sync the third is used to rule out the invalid time.
 
Old 09-07-2007, 11:05 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
ntp uses port 123, not 53. that's DNS.
 
Old 09-10-2007, 01:43 AM   #6
santhosh23
Member
 
Registered: Oct 2006
Posts: 40

Original Poster
Rep: Reputation: 15
Thanks for the Reply, i have reomved all the resticting parameter from the file.

ntp.conf

#Sample File
logfile /var/log/ntpd
logconfig =all
#NTP Server
server asia.pool.ntp.org prefer
server pool.ntp.org # A stratum 1 server at server.org
#server 65.211.109.12
# A stratum 2 server at research.gov


There are no restrictions set for port 123 on the network.


I still get the same error, i have tried with different ntp servers no luck.

please advise.


Thanks,
Santhosh
 
Old 09-10-2007, 03:10 AM   #7
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Quote:
Originally Posted by santhosh23 View Post
#Sample File
logfile /var/log/ntpd
logconfig =all
#NTP Server
server asia.pool.ntp.org prefer
server pool.ntp.org # A stratum 1 server at server.org
#server 65.211.109.12
# A stratum 2 server at research.gov


There are no restrictions set for port 123 on the network.


I still get the same error, i have tried with different ntp servers no luck.
If you are getting the same response from ntpq i.e. 16 which = server not found then then I have a couple of suggestions. (thank you acid-kewpie the port is indeed 123).
The first line in your config is incorrect btw;

For the servers (if you are going to use the pool servers) then use the following;

server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org

Using the above configuration along with the drift file below, ntp will determine the most accurate ntp source to use. Using 3 will enable it to also determine if one of the source servers is very inaccurate.

In the log section I don't see a reference to the drift file which is essential for ntp to function correctly;
eg in Debian it is;
driftfile /var/lib/ntp/ntp.drift
also in this section is the stats;
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 will need to restart ntp probably in /etc/init.d/

Last edited by TigerOC; 09-10-2007 at 03:13 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NTP sync problem. makkays Linux - Networking 4 05-02-2007 05:20 PM
NTP cannot work with timeserver, NTP-d can jerryvapps Linux - Networking 0 08-04-2004 03:04 PM
ntp problem,,, Anmar Linux - Software 0 03-26-2004 11:35 AM
NTP problem jaycee999 Linux - Networking 3 07-31-2002 11:14 PM
ntp problem ? virtaava Linux - Newbie 0 10-09-2001 06:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration