LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-18-2013, 10:14 AM   #1
grob115
Member
 
Registered: Oct 2005
Posts: 542

Rep: Reputation: 32
Unable to get ntp to sync up


Hi, have been on this for hours. I have verified that my Linux has its firewall opened on UDP 123, and I'm able to see the outgoing ntp request going out on my firewall. But no matter which NTP server I try, I'm always getting the "unsynchronised" result for the "ntpstat" command. And after a while, it'd say it's "synchronised to local net at stratum 11". Any idea what I can try?

Restart and test attempt
Code:
[root@test ~]# service ntpd restart
Shutting down ntpd:                                        [  OK  ]
Starting ntpd:                                             [  OK  ]

[root@test ~]# ntpstat
unsynchronised
  time server re-starting
   polling server every 64 s

[root@test ~]# ntpstat
synchronised to local net at stratum 11
   time correct to within 11 ms
   polling server every 1024 s

/var/log/messages
Code:
Feb 18 05:58:50 uat ntpd[3454]: ntpd exiting on signal 15
Feb 18 05:58:50 uat ntpd[23454]: ntpd 4.2.2p1@1.1570-o Sat Dec 19 00:56:13 UTC 2009 (1)
Feb 18 05:58:50 uat ntpd[23455]: precision = 1.000 usec
Feb 18 05:58:50 uat ntpd[23455]: Listening on interface wildcard, 0.0.0.0#123 Disabled
Feb 18 05:58:50 uat ntpd[23455]: Listening on interface wildcard, ::#123 Disabled
Feb 18 05:58:50 uat ntpd[23455]: Listening on interface lo, ::1#123 Enabled
Feb 18 05:58:50 uat ntpd[23455]: Listening on interface eth0, ff18::11f:29ff:fe83:1d11#123 Enabled
Feb 18 05:58:50 uat ntpd[23455]: Listening on interface lo, 127.0.0.1#123 Enabled
Feb 18 05:58:50 uat ntpd[23455]: Listening on interface eth0, 192.168.10.4#123 Enabled
Feb 18 05:58:50 uat ntpd[23455]: kernel time sync status 0040
Feb 18 05:58:50 uat ntpd[23455]: frequency initialized 45.873 PPM from /var/lib/ntp/drift
Feb 18 06:45:14 uat ntpd[23455]: synchronized to LOCAL(0), stratum 10
Feb 18 06:45:14 uat ntpd[23455]: kernel time sync disabled 0001
Feb 18 06:45:22 uat ntpd[23455]: ntpd exiting on signal 15
Feb 18 06:45:22 uat ntpd[23536]: ntpd 4.2.2p1@1.1570-o Sat Dec 19 00:56:13 UTC 2009 (1)
Feb 18 06:45:22 uat ntpd[23537]: precision = 1.000 usec
Feb 18 06:45:22 uat ntpd[23537]: Listening on interface wildcard, 0.0.0.0#123 Disabled
Feb 18 06:45:22 uat ntpd[23537]: Listening on interface wildcard, ::#123 Disabled
Feb 18 06:45:22 uat ntpd[23537]: Listening on interface lo, ::1#123 Enabled
Feb 18 06:45:22 uat ntpd[23537]: Listening on interface eth0, ff18::11f:29ff:fe83:1d11#123 Enabled
Feb 18 06:45:22 uat ntpd[23537]: Listening on interface lo, 127.0.0.1#123 Enabled
Feb 18 06:45:22 uat ntpd[23537]: Listening on interface eth0, 192.168.10.4#123 Enabled
Feb 18 06:45:22 uat ntpd[23537]: kernel time sync status 0040
Feb 18 06:45:22 uat ntpd[23537]: frequency initialized 45.873 PPM from /var/lib/ntp/drift
Feb 18 06:48:58 uat ntpd[23537]: synchronized to LOCAL(0), stratum 10
Feb 18 06:48:58 uat ntpd[23537]: kernel time sync enabled 0001
/etc/ntp.conf
Code:
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org
#server 1.centos.pool.ntp.org
#server 2.centos.pool.ntp.org
#server 0.pool.ntp.org
#server 1.pool.ntp.org
#server 2.pool.ntp.org
#server 3.pool.ntp.org
#server ntp0.state.vt.us
server 64.236.96.53

#broadcast 192.168.1.255 key 42         # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 key 42             # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 key 42  # manycast client

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
server 127.127.1.0
fudge   127.127.1.0 stratum 10

# Drift file.  Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
driftfile /var/lib/ntp/drift

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

# Specify the key identifier to use with the ntpq utility.
#controlkey 8
#restrict 0.centos.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
#restrict 1.centos.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
#restrict 2.centos.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
 
Old 02-18-2013, 10:44 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
once it's running, run "ntpq -pn" to dump the status of what it's doing. Also do "ntpq -pn 64.236.96.53" to see the same details about your prospective peer.
 
Old 02-19-2013, 10:56 AM   #3
grob115
Member
 
Registered: Oct 2005
Posts: 542

Original Poster
Rep: Reputation: 32
These are what I'm getting ....
Code:
[root@test ~]# service ntpd restart
Shutting down ntpd:                                        [FAILED]
Starting ntpd:                                             [  OK  ]
[root@test ~]# ntpq -pn
Temporary failure in name resolution
[root@test ~]# ntpq -pn
Temporary failure in name resolution
[root@test ~]# ntpq -pn 64.236.96.53
64.236.96.53: timed out, nothing received
***Request timed out
[root@test ~]# ntpq -pn 64.236.96.53
64.236.96.53: timed out, nothing received
***Request timed out
[root@test ~]#
 
Old 02-19-2013, 02:57 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well the remote box is not replying at all, so pesumably isn't reachable on the network. As for the local one... not seen that error before... do you not have a "localhost" entry in the hosts file or something?
 
Old 02-19-2013, 11:14 PM   #5
smbhandary
LQ Newbie
 
Registered: Jan 2013
Distribution: RHEL and AIX ( sort of )
Posts: 18

Rep: Reputation: Disabled
Based on my understanding of the problem statement.

stop ntp service.
lsof -i :123 -- to ensure its really really stopped. Do what you must to ensure the port is free.
ping the ntp server -- if its not reachable fix it.
ntpdate <ip of time server> -- sync time
start the ntp service
 
Old 02-20-2013, 03:19 AM   #6
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
@grod115 -Around few days back ,I have faced same sort of issue .

Its seems to not to be NTP client issue .I Guess NTP server port(123) is not opened for particularly for these NTP client Server .



#telnet ntpserver 123

You can try by checking whether you could able to capture the packets thats coming towards port 123 of your NTP client using network sniffer TCP Dump (or) wireshark .


#tcpdump -s0 -vvv -e -n -c 2 -i eth0 port 123


you can check how route IP datagrams travel from NTP client to NTP server

#tracert ntpserver


Capture any packets with destination IP (NTP Server) and destination port 123.

tcpdump -nnvvXSs "dst host NTPSERVER and dst port 123"

Last edited by jsaravana87; 02-20-2013 at 07:06 AM.
 
Old 02-20-2013, 05:22 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by arun5002 View Post
@grod115 -Around few days back ,I have faced same sort of issue .

Its seems to not to be NTP client issue .I Guess NTP server port(123) is not opened for particularly for these NTP client Server .



#telnet ntpserver 123
This is *VERY* wrong. NTP is a UDP protocol. telnet is a TCP client, you can NOT use telnet to test an NTP service.
 
  


Reply



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
Unable to sync time NTP server Rohit_4739 Linux - Newbie 5 04-10-2012 08:44 AM
NTP unable to sync jeewiz Linux - Newbie 12 10-24-2011 03:07 PM
NTP sync noir911 Linux - Server 1 03-29-2008 06:50 PM
NTP sync problem guillermo Linux - Hardware 1 11-19-2007 03:00 PM
NTP Sync? carlosinfl Linux - Networking 12 04-13-2006 10:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:50 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