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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-14-2014, 12:07 PM
|
#1
|
Member
Registered: Jan 2013
Distribution: Debian
Posts: 166
Rep:
|
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,
|
|
|
05-14-2014, 12:41 PM
|
#2
|
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,209
|
Looks like ntpd can't reach the servers: INIT state and all fields 0. Maybe firewall is blocking? grep the logs for ntpd.
|
|
|
05-14-2014, 01:03 PM
|
#3
|
Member
Registered: Jan 2013
Distribution: Debian
Posts: 166
Original Poster
Rep:
|
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.
|
|
|
05-14-2014, 01:56 PM
|
#4
|
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,209
|
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.
|
|
|
05-14-2014, 03:03 PM
|
#5
|
Member
Registered: Jan 2013
Distribution: Debian
Posts: 166
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 05:32 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|