LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-01-2011, 05:58 AM   #1
Peter Tan
LQ Newbie
 
Registered: Apr 2011
Posts: 7

Rep: Reputation: 0
NTP Error.


Hello,

I am a newbie on linux. I am trying to fix this for 4 days but still unable to sync with the Internet time server.
I am trying to do synchronize to the internet time server using my internal server (running on redhat) but it does not work at all.
After configuring the ntp.conf, i stop the ntpd and start again and still did not work. i able to update the Internet time server using ntpdate commad.

Please comment on my configuration and show me show direction.

[root@app3 ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
LOCAL(0) .LOCL. 10 l 8 64 1 0.000 0.000 0.001


[root@app3 ~]# /etc/init.d/ntpd stop
Shutting down ntpd: [ OK ]

Configuration file:

Running on:
[root@app3 /]# /bin/bash --version
GNU bash, version 3.2.25(1)-release (i686-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

I am able to update using ntpdate:
[root@app3 /]# ntpdate sg.pool.ntp.org
1 Apr 16:42:22 ntpdate[4812]: adjust time server 202.150.213.154 offset 0.036360 sec

Configuration file on /etc/ntp.conf

restrict default ignore
restrict 127.0.0.1

#allow synchronization sources from the internet servers
restrict server 3.sg.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict server 0.asia.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict server 2.asia.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery

#allow our internal server to synch to this server
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap noquery notrust

server 127.127.1.0 #local system clock
fudge 127.127.1.0 stratum 10
driftfile /etc/ntp/drift
logfile /var/log/ntp.log
 
Old 04-01-2011, 07:41 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
you've not defined what servers to use at all. It looks like you've confused the server and restrict directives and fudged them into a single line.

The lines that will actually tell ntp to go get the time are:

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

or similar.

I would remove those restrict lines relating to those servers completely.
 
Old 04-03-2011, 10:57 PM   #3
Peter Tan
LQ Newbie
 
Registered: Apr 2011
Posts: 7

Original Poster
Rep: Reputation: 0
Hi Acid,

I added the below entry:

#allow synchronization sources from the internet servers
server 2.sg.pool.ntp.org
server 0.asia.pool.ntp.org
server 2.asia.pool.ntp.org

and remove the below entry:
server 127.127.1.0 #local system clock
fudge 127.127.1.0 stratum 10


It worked perfectly.

may i know but what's wrong with the entry below
server 127.127.1.0 #local system clock
fudge 127.127.1.0 stratum 10

i need let the rest of my network server to sych to my local time clock if the internet time is down.
 
Old 04-04-2011, 03:17 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
why did you remove those other lines? You should keep them. They mean that ntp will use itself as a reference if the others go down, see manpage for details.
 
Old 04-04-2011, 03:53 AM   #5
Peter Tan
LQ Newbie
 
Registered: Apr 2011
Posts: 7

Original Poster
Rep: Reputation: 0
Hi Acid,

Initially when i configured it with :
server 127.127.1.0 #local system clock
fudge 127.127.1.0 stratum 10

I am not able to synch with the internet time server and i just found out, it is due to the internet time server down.
right now i am able to synch with the 3 internet time server, yahoo

192.168.1.8--------internal NTP network server.-------------------
restrict default ignore
restrict 127.0.0.1

#allow synchronization sources from the internet servers
server 2.sg.pool.ntp.org
server 0.asia.pool.ntp.org
server 2.asia.pool.ntp.org

#restict the type of access for each internet server
restrict 2.sg.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict 0.asia.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict 2.asia.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery

#allow our internal server to synch to this server
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap notrust

server 127.127.1.0 #local system clock
fudge 127.127.1.0 stratum 10

driftfile /etc/ntp/drift
logfile /var/log/ntp.log


Right now i had another issue, my internal network server(192.168.1.9 & 10) trying to synch with this local ntp server (192.168.1.8) could not work at all.is there something wrong with the config?

throw me :
# ntpdate -u 192.168.1.8
4 Apr 15:52:26 ntpdate[23031]: no server suitable for synchronization found

192.168.1.9 & 10--------internal client server.-------------------

server 192.168.1.8 prefer
restrict default ignore
restrict 127.0.0.1
restrict 192.168.1.8 mask 255.255.255.255 nomodify notrap noquery
driftfile /var/lib/ntp/drift


i followed the http://raghupathy.wordpress.com/2008...an-ntp-server/ steps:

Linux Client
To configure a Linux client to use the new server as a time source, the configuration file for the client should at least contain the following entries.

[bash]# vi /etc/ntp.conf
server 192.168.1.1
restrict default ignore
restrict 127.0.0.1
restrict 192.168.1.1 mask 255.255.255.255 nomodify notrap noquery
driftfile /var/lib/ntp/drift
 
Old 04-04-2011, 04:01 AM   #6
Peter Tan
LQ Newbie
 
Registered: Apr 2011
Posts: 7

Original Poster
Rep: Reputation: 0
This is what i have done
# ntpdate -d 192.168.1.8
4 Apr 15:54:24 ntpdate[23032]: ntpdate 4.2.2p1@1.1570-o Sat Dec 19 00:58:17 UTC 2009 (1)
Looking for host 192.168.1.8 and service ntp
host found : db
transmit(192.168.1.8)
transmit(192.168.1.8)
transmit(192.168.1.8)
transmit(192.168.1.8)
transmit(192.168.1.8)
192.168.1.8: Server dropped: no data
server 192.168.1.8, port 123
stratum 0, precision 0, leap 00, trust 000
refid [192.168.1.8], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time: 00000000.00000000 Thu, Feb 7 2036 14:28:16.000
originate timestamp: 00000000.00000000 Thu, Feb 7 2036 14:28:16.000
transmit timestamp: d143f7b3.4e58f712 Mon, Apr 4 2011 15:54:27.306
filter delay: 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
filter offset: 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000
delay 0.00000, dispersion 64.00000
offset 0.000000

somehow i understand that something is blocking in between but i able to ping from 192.168.1.9 to 192.168.1.8
 
Old 04-04-2011, 04:07 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
ntpdate has NO relevance to your ntp.conf, that is for ntpd only. If you have ntpdate failing then there is either a network or server side issue.
 
Old 04-04-2011, 05:27 AM   #8
Peter Tan
LQ Newbie
 
Registered: Apr 2011
Posts: 7

Original Poster
Rep: Reputation: 0
Hi Acid,

but how do i know that internal client server(192.168.1.9 & 10) is correctly synch the time with the
internal network sever (192.168.1.8) ?

At 192.168.1.9 & 10
i had ntpq -p 192.168.1.8

remote refid st t when poll reach delay offset jitter
==============================================================================
dyn107-b57-acce .INIT. 16 u - 1024 0 0.000 0.000 0.000
*ns.bio.keio.ac. 131.113.1.16 2 u 782 1024 377 87.127 -44482. 12.227
+CacheDNS-SBY.te 66.187.233.4 2 u 775 1024 377 401.304 -44476. 13.511
LOCAL(0) .LOCL. 10 l - 64 377 0.000 0.000 0.001

is it correctly synch with 192.168.1.8?
 
Old 04-04-2011, 08:40 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
no, it's not configured to connect to it in ntpd.conf so why would it be? btw, use "ntpq -pn" to not use dns lookups. What' you've done in that ntpq command is get the status OF 192.168.1.8, not see if you're using it. And as the server does not respond to your ntpdate requests you're again clearly not gonig to get any time from it.

Last edited by acid_kewpie; 04-04-2011 at 08:43 AM.
 
Old 04-04-2011, 09:04 AM   #10
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Could you please edit your posts and place [code][/code] tags around your code? This will preserve formatting and to improve readability. In particular it will keep those long lines from forcing the page to scroll horizontally.
 
  


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
[SOLVED] NTP Client Error -- ntpstat shows unsynchronised vikas027 Linux - Server 23 05-10-2012 02:19 AM
ntp Error msivadass Linux - Server 4 04-05-2011 01:13 AM
NTP Log Error Beginning in Slackware 13.1 tronayne Slackware 5 08-07-2010 05:12 AM
ntp drift file in /etc/ntp instead of /var/lib/ntp - suggestion for a patch in Slack niels.horn Slackware 16 05-07-2009 08:35 PM
NTP cannot work with timeserver, NTP-d can jerryvapps Linux - Networking 0 08-04-2004 03:04 PM


All times are GMT -5. The time now is 05:43 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration