What's new
  • 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!

Clients doesnt synronize systime from Router

Mars2035

Occasional Visitor
My Asus RT-AC56u (FW 380.62) is running mostly local without WAN, system time is set only by RTC clock at each boot. I was expecting that clients (Linux Rasp+ntp; added in ntp.conf "server <router ip>") can synchronize their systime from the router. But its not the case, which adjustment/services on router are in addition needed?

Thanks for the support.
Best regards.
 
Last edited:
I could be wrong but I didn't think Merlin's firmware had an NTP server. I thought it was only a client.

However, I see in the changelog for 380.65 Beta 1 that Busybox's ntpd has been added.
 
Ah, ok so a running ntpd service is needed at least?
I have Entware-ng installed and it offers ntpd too. I assume it doesnt matter which one I can use.
 
I have Entware-ng installed and it offers ntpd too. I assume it doesnt matter which one I can use?
I would use the Busybox version of ntpd. You will also need a firewall rule to redirect UDP port 123 to the router's NTP server, if you want all devices on your network to sync their clocks locally. Lastly, if your Internet access is not reliable, you will also want to redirect DNS lookups for any Internet time servers to the router.
 
I was expecting that clients (Linux Rasp+ntp; added in ntp.conf "server <router ip>") can synchronize their systime from the router. But its not the case, which adjustment/services on router are in addition needed?
You need to install a NTP Daemon for ASUSWRT/Merlin to get what you want! :rolleyes:
 
Here's a quick example for how to start the NTP server included with Busybox 1.25.1. I've only tested it with a Windows client and it seems to work fine. Apparently, there is no syslog output. Please correct me if I wrong.

/jffs/scripts/services-start
Code:
#!/bin/sh

# wait for the system clock to be synchronized via Asus "ntpclient"
while [ "$(nvram get ntp_ready)" != "1" ]; do
  /usr/bin/logger -t $(/usr/bin/basename $0) "custom script waiting for system clock to be synchronized [$$]"
  /bin/sleep 1
done

# now start the NTP server, only if the router's clock has been set
[ "$(nvram get ntp_ready)" == "1" ] && [ -z "$(/bin/pidof ntpd)" ] && /usr/sbin/ntpd -l -d
 
Not a good idea to run a NTP Server on these routers because they do not have a battery backup.
 
Not a good idea to run a NTP Server on these routers because they do not have a battery backup.
The router gets the actual time by an external RTC clock.
I would use the Busybox version of ntpd. You will also need a firewall rule to redirect UDP port 123 to the router's NTP server, if you want all devices on your network to sync their clocks locally.
Thanks Fitz, you mean the version that is introduced by the latest Beta? Well, I will test ntpd from Entware repo before I upgrade my running system. I didint know the firewall rule on UDP 123, I will check this on the AC56u. You script is a good starting point but I can change it a bit: After RTC-Clock has updated the systime I should start the ntpd server.
 
I have checked it minutes before on the webinterface but I cannot find how to set the firewall rule on UDP 123. Before I am running into big trouble and set sth. stupid, may somebody give me a hint how to set it on AC56u? The router has no WAN and should give access all local clients to ntpd.
 

Similar threads

Latest 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!
Back
Top