LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-14-2014, 12:07 PM   #1
stateless
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 166
Blog Entries: 1

Rep: Reputation: 4
ntp: why am I not in sync with the rest of the world?


Hi. I am simply trying to configure a Debian workstation to have accurate time via ntp. I installed ntp, and kept it using the default config file (with debian ntp pool). But I am confused: the values returned by both the "date" command and "ntptime" are about three minutes different from my local university time, as well as the time displayed on several time display Web sites I've visited (which all agree with the university time). I tried switching from debian pool to the university ntp server, but no change. Please advise.

Code:
# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 host2.kingrst.c .INIT.          16 u    -  128    0    0.000    0.000   0.000
 162.250.145.46  .INIT.          16 u    -  128    0    0.000    0.000   0.000
 2607:fcd0:daaa: .INIT.          16 u    -  128    0    0.000    0.000   0.000
 lani.12.am      .INIT.          16 u    -  128    0    0.000    0.000   0.000
# ntptime
ntp_gettime() returns code 0 (OK)
  time d71e20d4.c298d000  Wed, May 14 2014  9:05:24.760, (.760144),
  maximum error 329016 us, estimated error 16 us, TAI offset 0
ntp_adjtime() returns code 0 (OK)
  modes 0x0 (),
  offset 0.000 us, frequency 0.000 ppm, interval 1 s,
  maximum error 329016 us, estimated error 16 us,
  status 0x1 (PLL),
  time constant 7, precision 1.000 us, tolerance 500 ppm,
 
Old 05-14-2014, 12:41 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,209

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Looks like ntpd can't reach the servers: INIT state and all fields 0. Maybe firewall is blocking? grep the logs for ntpd.
 
Old 05-14-2014, 01:03 PM   #3
stateless
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 166

Original Poster
Blog Entries: 1

Rep: Reputation: 4
Here's the syslog:

Code:
root@<snip>:~# grep ntp /var/log/syslog
May 14 08:54:26 <snip> ntpd[12024]: ntpd 4.2.6p5@1.2349-o Sat May 12 09:54:55 UTC 2012 (1)
May 14 08:54:26 <snip> ntpd[12025]: proto: precision = 0.100 usec
May 14 08:54:26 <snip> ntpd[12025]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
May 14 08:54:26 <snip> ntpd[12025]: Listen and drop on 1 v6wildcard :: UDP 123
May 14 08:54:26 <snip> ntpd[12025]: Listen normally on 2 lo 127.0.0.1 UDP 123
May 14 08:54:26 <snip> ntpd[12025]: Listen normally on 3 eth0 <snip> UDP 123
May 14 08:54:26 <snip> ntpd[12025]: Listen normally on 4 eth0 <snip> UDP 123
May 14 08:54:26 <snip> ntpd[12025]: Listen normally on 5 eth0 <snip> UDP 123
May 14 08:54:26 <snip> ntpd[12025]: Listen normally on 6 lo ::1 UDP 123
May 14 08:54:26 <snip> ntpd[12025]: peers refreshed
May 14 08:54:26 <snip> ntpd[12025]: Listening on routing socket on fd #23 for interface updates
I don't have to have any ports open into my workstation, right? (Just outgoing connections?)

Code:
# iptables -S
-P INPUT DROP
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p icmp -j ACCEPT
It seems quite plausible there could be a firewall problem in my department's network configuration. I'll check into this.
 
Old 05-14-2014, 01:56 PM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,209

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Unless you configured something very oddly then there are no connections in ntp. It runs on UDP port 123 and is bidirectional, so must be open for sending and receiving packets.
 
Old 05-14-2014, 03:03 PM   #5
stateless
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 166

Original Poster
Blog Entries: 1

Rep: Reputation: 4
I opened up the udp port, but this didn't seem to be enough. So I did a little more research, and it looks like it was a firewall issue. Found out we had our own local ntp server, and that one seems to work fine for me.
 
  


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 noir911 Linux - Server 1 03-29-2008 06:50 PM
NTP sync problem. makkays Linux - Networking 4 05-02-2007 04:20 PM
World of Warcraft on Wine - Partial Success! (Help me figure out rest) Nalorin Linux - Games 2 08-16-2006 08:12 PM
NTP Sync? carlosinfl Linux - Networking 12 04-13-2006 10:33 AM
Help for the rest of the world, LOL BajaNick General 25 11-12-2003 12:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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