NTP server does not work

{
        "kernel": "4.14.180",
        "hostname": "charon",
        "system": "ARMv7 Processor rev 0 (v7l)",
        "model": "TP-Link Archer C2600",
        "board_name": "tplink,c2600",
        "release": {
                "distribution": "OpenWrt",
                "version": "19.07.3",
                "revision": "r11063-85e04e9f46",
                "target": "ipq806x/generic",
                "description": "OpenWrt 19.07.3 r11063-85e04
e9f46"
        }
}
ntpd - 4.2.8p15-1
driftfile /var/lib/ntp/ntp.drift
restrict default ignore
restrict 192.168.0.0 mask 255.255.240.0 limited kod nomodify
 notrap nopeer noquery
restrict source noquery
restrict 127.0.0.1
server 192.168.0.10 iburst
server time.cloudflare.com iburst
system.ntp=timeserver
system.ntp.enabled='0'
1
0
1 Like

Also, i don't understand the init script. It seems to reset the ntpd config file when starting an instance but the file remains unchanged. I don't know how to debug that :frowning:

If that helps: the directory /var/lib/ntp/ is empty. Even stays empty if i start that command manually.

Enable the UCI section and add the NTP servers:

uci set system.ntp.enabled="1"
uci set system.ntp.enable_server="1"
uci -q delete system.ntp.server
uci add_list system.ntp.server="0.openwrt.pool.ntp.org"
uci add_list system.ntp.server="1.openwrt.pool.ntp.org"
uci add_list system.ntp.server="2.openwrt.pool.ntp.org"
uci add_list system.ntp.server="3.openwrt.pool.ntp.org"
uci commit system
/etc/init.d/ntpd restart

See also:
https://github.com/openwrt/packages/blob/master/net/ntpd/README.md

Note that the /var config is runtime, so do not edit it.

1 Like

That's it. I didn't read the readme :frowning:

Everything is working now. But it says it's 4am already.. so i better go to bed now.

Thank you very much for your help.

1 Like

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