What's new

NTP problem

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

tomdjpn

New Around Here
I have Asuswrt-Merlin (3.0.0.4.260.21) running on my Asus RT-AC66U.
Generally it works very well, but I have one particular problem...

Although the NTP server is set in the GUI (pool.ntp.org), the router never seems to actually get the time from the server when it is booted.
Hence, after booting it is always resetting to the default date/time.

This is a problem for me as I want to use the OpenVPN client, which needs correct date/time set for the TLS authentication with the VPN server.

If I enter "vpnclient -h pool.ntp.org -s" in "Run Cmd" in the GUI, it does find the server and updates the time properly.
Similarly, if I telnet to the router and either type the same, or just "ntp", again it finds the right time. (Just typing "ntp" at "Run Cmd" seems to crash the GUI web server, for whatever reason...).

However, I tried adding the above line to wan-start JFFS script (with correct permissions etc), but it still doesn't seem to work when the router is rebooted.

Any ideas much appreciated...
 
Try this in your wan-start (untested):

#!/bin/sh
sleep 10
service restart_ntpc
 
I have the same problem. After going to Administration/System and setting the NTP server to a local server pool: "au.pool.ntp.org" it all worked.
 
I also had this issue, once you select "apply" on the admin system page it will display the time but if it reboots then I have to go back and re apply the settings to have it fetch the time.

Steve
 
Thanks for all the responses.
Based on these, I found another reference on the web that says Tomato's boot order runs NTP before launching dnsmasq, and that if you instead put the IP address of the server instead, it works.
I can confirm indeed that this indeed works for me as a workaround.

The reason I wanted to have NTP sorted out during initial boot is that I have my vpnclient starting with WAN up (set in the firmware UI), so didnt want to add extra commands in wan up scripts because I dont know what order they will occur with respect to the vpnclient starting...
Anyway, so far it seems to be working, so thanks for the feedback.
 
Old topic that I found with Google, but it may be found by others too so here is what I ended up inserting into wan-start:

Code:
...

#Network time server IP address -- change to server in your time zone
NTPHOST="206.108.0.132"

...

#update the system clock first, so the date stamp is correct
    ntpclient -s -h $NTPHOST 
 ...

Tested and works well.
 
Same problem here.

I'm running the latest stable Merlin firmware (376.49_5) on ASUS RT-AC68U. My date is never updated through ntp.

I've tried everything:
  • changing the ntp server
  • manually setting daylight saving
  • ntpclient -s -h 193.204.114.232 from ssh (date unchanged)
  • ntpclient -l -h 193.204.114.232 from ssh (date unchanged)
  • service restart_ntpc
  • wan-start script with sleep time and any of the the above commands

I can change the date manually with "date 020612552015".
Also: my timezone is not set either (I keep getting MZT).

What can I try?
Thanks!
 
No suggestions?

My ISP blocks NTP over IPv4 for some bizarre reason so I do the following to set the router's time in a wan-start script:

Code:
date -s "$(curl -sD - google.com | grep ^Date: | cut -d' ' -f3-6)Z"
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top