Proper NTP configuration

Hi guys! Need some assistance .
I tried to configure ntp as a client and server on OpenWrt 23.05.2. And there was no luck. Why does the busybox-ntpd works only on a ipv6 interface? Any ideas?

netstat -tulpn | grep ntp
udp        0      0 :::123                  :::*                                6724/ntpd

I was unable to configure it properly.

After that I installed ntpd according to this article

opkg install ntpd
/etc/init.d/sysntpd disable
/etc/init.d/ntpd enable
/etc/init.d/ntpd start

and looks like it's up and running

netstat -tulpn | grep 123
udp        0      0 127.0.0.1:123           0.0.0.0:*                           3702/ntpd
udp        0      0 0.0.0.0:123             0.0.0.0:*                           3702/ntpd
udp        0      0 ::1:123                 :::*                                3702/ntpd
udp        0      0 :::123                  :::*                                3702/ntpd

but I can't understand why there are no any changes in "delay offset jitter" columns. Is it normal?

ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 162.159.200.123 .INIT.          16 u    -   64    0    0.000   +0.000   0.000
 212.160.106.226 .INIT.          16 u    -   64    0    0.000   +0.000   0.000
 162.159.200.1   .INIT.          16 u    -   64    0    0.000   +0.000   0.000
 178.215.228.24  .INIT.          16 u    -   64    0    0.000   +0.000   0.000

ntpq -c sysinfo
associd=0 status=c016 leap_alarm, sync_unspec, 1 event, restart,
system peer:        0.0.0.0:0
system peer mode:   unspec
leap indicator:     11
stratum:            16
log2 precision:     -20
root delay:         0.000
root dispersion:    3.705
reference ID:       INIT
reference time:     (no time)
system jitter:      0.000000
clock jitter:       0.001
clock wander:       0.000
broadcast delay:    -50.000
symm. auth. delay:  0.000

From what I understood, ntpd works as client and as server (for LAN devices) in a same time. Is it correct?
When I tried to edit /var/etc/ntpd.conf file, it was overwritten after a ntpd restart. Like a default configuration. Is it normal behavior for ntpd?
My goal is to configure ntpd as client for upstrem servers (to update router's time) and as a server to serve LAN devices. Could somebody you please assist me with ntpd configuration?

Welcome to the community!

Please show /etc/config/system where you enabled the NTP server in the config.

Once enabled the NTP server listens on on IPv4 as well as IPv6s. See this thread:

2 Likes

Thank you!

For now it looks like that

cat /etc/config/system

config system
        option hostname 'test11'
        option timezone 'CET-1CEST,M3.5.0,M10.5.0/3'
        option ttylogin '0'
        option log_size '64'
        option urandom_seed '0'
        option compat_version '1.1'
        option zonename 'Europe/Berlin'
        option log_proto 'udp'
        option conloglevel '8'
        option cronloglevel '5'

config timeserver 'ntp'
        option enable_server '1'
        list server '0.openwrt.pool.ntp.org'
        list server '1.openwrt.pool.ntp.org'
        list server '2.openwrt.pool.ntp.org'
        list server '3.openwrt.pool.ntp.org'
        option use_dhcp '0'
        option interface 'lan'

You don't need to install ntp as the busybox does its job fine. The IPv4 mapped IPv6 addresses was answered earlier.

No, it is not, but you can see that the stratum column is 16 which means that it was not able to communicate to the ntp servers.

3 Likes

Thank you for help and for a great explanation!

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