Trying to get standard NTPD to run

and it runs but doesn’t connect to external servers …….

root@OpenWrt:~# ps -w | grep ntp
3401 ntp 6124 S /sbin/ntpd -g -u ntp:ntp -p /var/run/ntpd.pid -n -c /var/etc/ntpd.conf
3402 root 1340 S {ntpd.hotplug-he} /bin/sh /usr/sbin/ntpd.hotplug-helper
3757 root 1336 S grep ntp

root@OpenWrt:~# ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 2a00:d78:0:712: .INIT.          16 u    -   64    0    0.000   +0.000   0.000
 129.250.35.251  .INIT.          16 u    -   64    0    0.000   +0.000   0.000
 2400:8907:e001: .INIT.          16 u    -   64    0    0.000   +0.000   0.000
 2403:5800:200:d .INIT.          16 u    -   64    0    0.000   +0.000   0.000

root@OpenWrt:~# cat /etc/ntp.conf
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

interface listen lan
interface listen lo

server ntp2.time.nl iburst
server 3.au.pool.ntp.org iburst
server 2.au.pool.ntp.org iburst
server ntp-syd.aussiebroadband.com.au iburst

I am seeking help on how to troubleshoot this???

Im not sure but maybe this will help you :slight_smile:
I would be curious to know if this helps you because i've been strugglin with these things too

No - that did not help. Just tried ntpdate and it works after stopping ntpd….

root@OpenWrt:/mnt/ssd/log# ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 2a00:d78:0:712: .INIT.          16 u    - 1024    0    0.000   +0.000   0.000
 129.250.35.251  .INIT.          16 u    - 1024    0    0.000   +0.000   0.000
 2400:8907:e001: .INIT.          16 u    - 1024    0    0.000   +0.000   0.000
 2403:5800:200:d .INIT.          16 u    - 1024    0    0.000   +0.000   0.000
root@OpenWrt:/mnt/ssd/log# ntpdate 129.250.35.251
30 Dec 03:35:59 ntpdate[5104]: the NTP socket is in use, exiting
root@OpenWrt:/mnt/ssd/log# /etc/init.d/ntpd stop
root@OpenWrt:/mnt/ssd/log# ntpdate 129.250.35.251
30 Dec 03:36:52 ntpdate[5145]: step time server 129.250.35.251 offset +0.616187 sec



maybe you could try one of the different packages listed on that page

Yes - I have installed ntpd and ntp-utils and ntpdate. ntpdate works as expected.

I think I have disabled the sysntpd that comes standard with Busybox,

Thanks for the suggestions ….

Are you running this on an OO?

If so, it has a rtc. Put a battery in it, add ntpdate 1.au.pool.ntp.org in /etc/rc.local. Done.

Yes, an Openwrt One.

As I said, the OO has a Real Time Clock on board (unusual in a plastic router), put a CR1220 coin cell battery in it. They typically last +3-5 years.

In the meantime, you really shouldn’t need the full ISC ntp suite utility. You’re using your national time server pool, that should work just fine with the busybox implementation.

Change ‘openwrt’ to ‘au’ in the example, and restart the daemon /etc/init.d/sysntpd start .

I add the ntpdate entry in rc.local that runs immediately after Init to correct any drift following a reboot.

1 Like

Technically NTP never connects as it uses UDP.
Since you use hostnames in ntpd but IP addresses in ntpdate let me bet on some race against DNS.
You can use ntp pool fully

I have installed the battery and have been using the Busybox ntp …… works fine.

I would like to use the ISC ntpd and don’t understand why it does not work….?

First step would be looking for lookup errors and unreachable servers in logread -e ntp

Please set servers to the example in ntppool page. Your config is biased towards IPv6, and then you test excluding DNS lookup.
WHat do you get in

nslookup 2.openwrt.pool.ntp.org

?

There are no log entries about lookup errors and unreachable servers ….

and the nslookup looks normal (to me)

oot@OpenWrt:/mnt/ssd/log# nslookup 2.openwrt.pool.ntp.org
Server: 127.0.0.1
Address: 127.0.0.1:53

Non-authoritative answer:
Name: 2.openwrt.pool.ntp.org
Address: 129.250.35.251
Name: 2.openwrt.pool.ntp.org
Address: 160.30.139.11
Name: 2.openwrt.pool.ntp.org
Address: 119.18.6.37
Name: 2.openwrt.pool.ntp.org
Address: 162.159.200.123

Non-authoritative answer:
Name: 2.openwrt.pool.ntp.org
Address: 2001:44b8:2100:3f00::7b:7
Name: 2.openwrt.pool.ntp.org
Address: 2402:1f00:8100:400::211a
Name: 2.openwrt.pool.ntp.org
Address: 2400:8907::f03c:93ff:fe5b:8a26
Name: 2.openwrt.pool.ntp.org
Address: 2400:8907::2000:d4ff:fe97:11f3

What is in generated conf in /var/etc/ntp.conf ?

https://github.com/openwrt/packages/tree/master/net/ntpd (readme file !!!)

I know this might not be the answer you want, but chrony works perfectly for me.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.