NTP wont update time on boot

OpenWrt 23.05.1
OpenWrt 23.05.2
OpenWrt 23.05.3
COMFAST CF-E110N v2
i read https://openwrt.org/docs/guide-user/advanced/ntp_configuration

and https://openwrt.org/docs/guide-user/services/ntp/client-server
NTP never updates time on boot by itself.
But if i go system -genegral setting and cklic sync with NTP-server button all good it got correct time
where do i dig up
using comand like
ntpd -q -p ptbtime1.ptb.de
also does sync the time

Also tried to use

root@kikas_1:~# ntpq
ntpq> peers
ntpq: read: Connection refused
ntpq>

/etc/config/system

config timeserver 'ntp'
	list server 'pool.ntp.org'
	option use_dhcp '0'

I put the script at statup

sleep 30 && ntpd -q -p 0.openwrt.pool.ntp.org

And the thing is if i remove sleep 30 the time wont be correct.
Also i disabled firewall dnsmsq

Your device is NOT supported by OpenWRT.
busybox ntpd will not respond to ntpq queries.


why not ?

1 Like

because selector glitched in my face :slight_smile:

Does it never sync or it syncs after extended time?

Did you disable it or uninstall it? There’s an ntp cronjob included with the dnsmasq package. Removing dnsmasq will also remove this cronjob.

1 Like

Are you using DoH, DoT, or DNSSEC?

i turned on dnsmsq and all works correctly now on start ,but anyway if dnsmsq disabled i still can syncronise using command but not after start but 30 seconds later

it doesnt syncs on start but if i add 30 secund to wait then run the comand to cyncronise all works

There is no logical correlation between the firewall and dnsmasq and ntp. If you run OpenWrt as switch or dumb access point firmware you can build the firmware without the firewall and/or dnsmasq package and the ntp client works anyway since it is in the busybox core package.

But if you don’t have dnsmasq and no other dns masquerading system in your network and firewall to be precise, then pretty much nothing in the network will have internet access.

I mentioned cronjob but looking at my notes the issue seemed to involve a hotplug not a cronjob. This was about ~4 months ago building from 23.05 SNAPSHOT.

I just compiled an image for a dumb AP from 23.05 SNAPSHOT without dnsmasq and ntp is now updating at boot time. So, I can’t recreate the problem.

As for OP’s issue, it’s odd that their script was able to update ntp with dnsmasq disabled and that re-enabling dnsmasq solved the problem. It sounds like what I was facing.

1 Like

I think at least snapshot even excludes Do??? proxies for ntp dns lookup.

Sorry for the confusion. Just noticed in my notes that my issue was related to this bug:

https://github.com/openwrt/openwrt/issues/10389

With more info, this might be what OP was experiencing

able but only 30 second late after system booted

See the bug report I linked above. Also, see this post/thread for more info.

An Interface with the Protocol set to DHCP with dnsmasq disabled on a dumb AP hits this ujail/sysntpd bug. That was my finding.

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