# Ntpd client not sync time when server is reachable

**URL:** <https://community.ntppool.org/t/ntpd-client-not-sync-time-when-server-is-reachable/2363>\
**Category:** Client Configuration and Development\
**Created:** [April 27, 2022, 1:01pm UTC](https://community.ntppool.org/t/ntpd-client-not-sync-time-when-server-is-reachable/2363 "2022-04-27T13:01:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wujinge](https://avatars.discourse-cdn.com/v4/letter/w/c89c15/32.png) [@wujinge](https://community.ntppool.org/u/wujinge)\
**Post date:** [April 27, 2022, 1:01pm UTC](https://community.ntppool.org/t/ntpd-client-not-sync-time-when-server-is-reachable/2363/1 "2022-04-27T13:01:33Z")

</div>

**Version** ntpd 4.2.8p15@1.3728-o Tue Apr 26 08:01:21 UTC 2022 (3)  
/usr/sbin/ntpd -d -g -p /var/run/ntpd.pid -n -c /etc/ntpd.conf  
5 Apr 10:55:47 ntpd[3167]: ntpd 4.2.8p15@1.3728-o Tue Apr 26 08:01:21 UTC 2022 (3): Starting  
5 Apr 10:55:47 ntpd[3167]: Command line: /usr/sbin/ntpd -d -g -p /var/run/ntpd.pid -n -c /etc/ntpd.conf  
5 Apr 10:55:47 ntpd[3167]: ----------------------------------------------------  
5 Apr 10:55:47 ntpd[3167]: ntp-4 is maintained by Network Time Foundation,  
5 Apr 10:55:47 ntpd[3167]: Inc. (NTF), a non-profit 501(c)(3) public-benefit  
5 Apr 10:55:47 ntpd[3167]: corporation. Support and training for ntp-4 are  
5 Apr 10:55:47 ntpd[3167]: available at [Support - Network Time Foundation](https://www.nwtime.org/support)  
5 Apr 10:55:47 ntpd[3167]: ----------------------------------------------------  
5 Apr 10:55:47 ntpd[3167]: proto: precision = 10.000 usec (-17)  
Finished Parsing!!  
5 Apr 10:55:47 ntpd[3167]: basedate set to 2022-04-14  
5 Apr 10:55:47 ntpd[3167]: gps base set to 2022-04-17 (week 2206)  
hack\_restrict: op RESTRICT\_FLAGS addr 0.0.0.0 mask 0.0.0.0 ippeerlimit -1 mflags 00000000 rflags 00000b50  
hack\_restrict: op RESTRICT\_FLAGS addr :: mask :: ippeerlimit -1 mflags 00000000 rflags 00000b50  
hack\_restrict: op RESTRICT\_FLAGS addr :: mask :: ippeerlimit -1 mflags 00000000 rflags 00000b50  
restrict source template ippeerlimit -1 mflags 4000 rflags 80  
hack\_restrict: op RESTRICT\_FLAGS addr (null) mask (null) ippeerlimit -1 mflags 00004000 rflags 00000080  
hack\_restrict: op RESTRICT\_FLAGS addr 127.0.0.1 mask 255.255.255.255 ippeerlimit -1 mflags 00000000 rflags 00000000  
hack\_restrict: op RESTRICT\_FLAGS addr ::1 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ippeerlimit -1 mflags 00000000 rflags 00000000  
move\_fd: estimated max descriptors: 1024, initial socket boundary: 16  
5 Apr 10:55:47 ntpd[3167]: Listen and drop on 0 v6wildcard [::]:123  
5 Apr 10:55:47 ntpd[3167]: Listen and drop on 1 v4wildcard 0.0.0.0:123  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 2 lo 127.0.0.1:123  
hack\_restrict: op RESTRICT\_FLAGS addr 127.0.0.1 mask 255.255.255.255 ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 3 eth0 192.168.40.208:123  
hack\_restrict: op RESTRICT\_FLAGS addr 192.168.40.208 mask 255.255.255.255 ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 4 vlan20 192.168.228.1:123  
hack\_restrict: op RESTRICT\_FLAGS addr 192.168.228.1 mask 255.255.255.255 ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 5 vlan10 192.168.208.1:123  
hack\_restrict: op RESTRICT\_FLAGS addr 192.168.208.1 mask 255.255.255.255 ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 6 Bridge0 192.168.1.1:123  
hack\_restrict: op RESTRICT\_FLAGS addr 192.168.1.1 mask 255.255.255.255 ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 7 lo [::1]:123  
hack\_restrict: op RESTRICT\_FLAGS addr ::1 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 8 ifb0 [fe80::1484:d7ff:fe8a:f11d%21]:123  
hack\_restrict: op RESTRICT\_FLAGS addr fe80::1484:d7ff:fe8a:f11d%21 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 9 ifb1 [fe80::8dc:c8ff:fe47:beb3%22]:123  
hack\_restrict: op RESTRICT\_FLAGS addr fe80::8dc:c8ff:fe47:beb3%22 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 10 eth0 [fe80::26e1:24ff:fef0:dbde%26]:123  
hack\_restrict: op RESTRICT\_FLAGS addr fe80::26e1:24ff:fef0:dbde%26 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 11 eth1 [fe80::26e1:24ff:fef0:dbdf%27]:123  
hack\_restrict: op RESTRICT\_FLAGS addr fe80::26e1:24ff:fef0:dbdf%27 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 12 vlan20 [fe80::26e1:24ff:fef0:dbdf%33]:123  
hack\_restrict: op RESTRICT\_FLAGS addr fe80::26e1:24ff:fef0:dbdf%33 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 13 vlan10 [fe80::26e1:24ff:fef0:dbdf%34]:123  
hack\_restrict: op RESTRICT\_FLAGS addr fe80::26e1:24ff:fef0:dbdf%34 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 14 Bridge0 [fe80::184a:8aff:fe0d:e60a%43]:123  
hack\_restrict: op RESTRICT\_FLAGS addr fe80::184a:8aff:fe0d:e60a%43 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 15 ath0 [fe80::26e1:24ff:fef0:dbe0%48]:123  
hack\_restrict: op RESTRICT\_FLAGS addr fe80::26e1:24ff:fef0:dbe0%48 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listen normally on 16 ath1 [fe80::26e1:24ff:fef0:dbe1%49]:123  
hack\_restrict: op RESTRICT\_FLAGS addr fe80::26e1:24ff:fef0:dbe1%49 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ippeerlimit -4 mflags 00003000 rflags 00000001  
5 Apr 10:55:47 ntpd[3167]: Listening on routing socket on fd #33 for interface updates  
newpeer(192.168.41.150) - ippeerlimit -1 ignored  
key\_expire: at 0 associd 23577  
peer\_clear: at 0 next 1 associd 23577 refid INIT  
hack\_restrict: op RESTRICT\_FLAGS addr 192.168.41.150 mask 255.255.255.255 ippeerlimit -1 mflags 00004000 rflags 00000080  
restrict\_source: 192.168.41.150 host restriction added  
event at 0 192.168.41.150 8011 81 mobilize assoc 23577  
newpeer: -\>192.168.41.150 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000  
kernel loop status 0x2041 (Clock Unsynchronized)  
5 Apr 10:55:47 ntpd[3167]: kernel reports TIME\_ERROR: 0x2041: Clock Unsynchronized  
event at 0 0.0.0.0 c01d 0d kern kernel time sync enabled  
kernel loop status 0x2041 (Clock Unsynchronized)  
5 Apr 10:55:47 ntpd[3167]: kernel reports TIME\_ERROR: 0x2041: Clock Unsynchronized  
event at 0 0.0.0.0 c012 02 freq\_set kernel 10.834 PPM  
event at 0 0.0.0.0 c016 06 restart  
auth\_agekeys: at 1 keys 0 expired 0

**I run ntpd when network is unreachable， when the server is reachable， it can not sync time auto**

my ntp.conf is  
**driftfile /var/lib/ntp/ntp.drift**

**restrict default limited kod nomodify notrap nopeer**  
**restrict -6 default limited kod nomodify notrap nopeer**  
**restrict source noquery**

**# No limits for local monitoring**  
**restrict 127.0.0.1**  
**restrict -6 ::1**

**server 192.168.41.150 iburst**

Someone can help me 😭

---

<div class="post-metadata">

**Author:** ![NTPman](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/ntpman/32/450_2.png) [@NTPman](https://community.ntppool.org/u/NTPman)\
**Post date:** [April 29, 2022, 4:42am UTC](https://community.ntppool.org/t/ntpd-client-not-sync-time-when-server-is-reachable/2363/2 "2022-04-29T04:42:47Z")

</div>

Normally, more than one time server is recommended to configure as time provider, at least three. What does the command  
`ntpq -p -n`  
give?

---

<div class="post-metadata">

**Author:** ![Bas](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/bas/32/465_2.png) [@Bas](https://community.ntppool.org/u/Bas)\
**Post date:** [April 30, 2022, 6:12pm UTC](https://community.ntppool.org/t/ntpd-client-not-sync-time-when-server-is-reachable/2363/3 "2022-04-30T18:12:35Z")

</div>

apt install chrony

Then edit /etc/chrony/chrony.conf

Far easier if you install Stratum2.
