LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   NTP problem (https://www.linuxquestions.org/questions/linux-networking-3/ntp-problem-582864/)

santhosh23 09-07-2007 03:51 AM

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

acid_kewpie 09-07-2007 03:56 AM

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)

TigerOC 09-07-2007 07:39 AM

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.

Slick666 09-07-2007 08:06 AM

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.

acid_kewpie 09-07-2007 11:05 AM

ntp uses port 123, not 53. that's DNS.

santhosh23 09-10-2007 01:43 AM

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

TigerOC 09-10-2007 03:10 AM

Quote:

Originally Posted by santhosh23 (Post 2887157)
#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/


All times are GMT -5. The time now is 05:39 PM.