I'm using Linux Debian Wheezy.I have problem to sync time & date between my server & PC,and the ntp servers looks like pointing at itself not internet.
In this case,Fig is my NTP server.
root@fig [5156]# ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== fig.nta-monitor .INIT. 16 u - 1024 0 0.000 0.000 0.000
My NTP Server ntp.conf file:
root@fig [5155]# less /etc/ntp.conf # /etc/ntp.conf, configuration for ntpd driftfile /var/lib/ntp/ntp.drift 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 server 0.my.pool.ntp.org iburst server 1.my.pool.ntp.org iburst server 2.my.pool.ntp.org iburst server 3.my.pool.ntp.org iburst server 0.asia.pool.ntp.org iburst server 1.asia.pool.ntp.org iburst # ... and use the local system clock as a reference if all else fails # NOTE: in a local network, set the local stratum of *one* stable server # to 10; otherwise your clocks will drift apart if you lose connectivity. server 127.127.1.0 fudge 127.127.1.0 stratum 13 # By default, exchange time with everybody, but don't allow configuration. restrict -4 default kod notrap nomodify nopeer noquery restrict -6 default kod notrap nomodify nopeer noquery # Local users may interrogate the ntp server more closely. restrict 127.0.0.1 nomodify
This is the information for my server & client
NTP Server = 192.168.120.104 (Fig) Client = 192.168.120.65 (Banana)
Please advice.Thanks
Now the issue is why my NTP server used itself as ntp server?
This is what I ping for the pool from NTP server(fig)
root@fig [5246]# ping 0.my.pool.ntp.org PING 0.my.pool.ntp.org (202.45.138.123) 56(84) bytes of data.
But got reply when i ping to yahoo.com
root@fig [5247]# ping yahoo.com PING yahoo.com (98.138.253.109) 56(84) bytes of data. 64 bytes from ir1.fp.vip.ne1.yahoo.com (98.138.253.109): icmp_req=1 ttl=39 time=333 ms 64 bytes from ir1.fp.vip.ne1.yahoo.com (98.138.253.109): icmp_req=2 ttl=39 time=332 ms 64 bytes from ir1.fp.vip.ne1.yahoo.com (98.138.253.109): icmp_req=3 ttl=39 time=332 ms 64 bytes from ir1.fp.vip.ne1.yahoo.com (98.138.253.109): icmp_req=4 ttl=39 time=335 ms ^C --- yahoo.com ping statistics --- 5 packets transmitted, 4 received, 20% packet loss, time 4003ms rtt min/avg/max/mdev = 332.398/333.454/335.464/1.263 ms
This is the output when I run ps -ef | grep [n]tp command
root@fig [5213]# ps -ef | grep [n]tp ntp 22526 1 0 13:24 ? 00:00:01 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -c /var/lib/ntp/ntp.conf.dhcp -u 101:108
This is the result when I run ntpdate -qu 202.45.138.123 command
root@fig [5215]# ntpdate -qu 202.45.138.123 server 202.45.138.123, stratum 2, offset -135.572409, delay 0.06105 1 Sep 19:18:29 ntpdate[27420]: step time server 202.45.138.123 offset -135.572409 sec
ntpd
can you update the clock by command line? – Rahul Sep 01 '16 at 09:23ntpq -p
for each of yourserver
lines. Since you've only got the fudged localhost entry I would say thatntpd
couldn't resolve the server names when it started. If you restart the daemon does it start working as expected? – Chris Davies Sep 01 '16 at 09:28ntpq -p
in your question is from fig, yes? – Chris Davies Sep 01 '16 at 09:47This is the output for fig ntpq -p
root@fig [5230]# ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== fig.nta-monitor .INIT. 16 u - 1024 0 0.000 0.000 0.000
– Kamal Sep 01 '16 at 09:490.my.pool.ntp.org
successfully? (Useping
or something. It doesn't matter whether the host replies. What's important is that the name resolves to an IP address.) – Chris Davies Sep 01 '16 at 10:480.my.pool.ntp.org
currently resolves to202.45.138.123
. For me, that is a valid NTP server. So, please can you provide output of running this command on fig -ps -ef | grep [n]tp
. Also the output ofntpdate -qu 202.45.138.123
(you may need to install thentpdate
package). – Chris Davies Sep 01 '16 at 11:10