Setting time on DD-WRT, an alternative

Setting time on DD-WRT, an alternative

If the documented method of using NTP client in DD-WRT’s GUI works there is of course no need to do anything different.

There are not many reasons to have accurate time on a DD-WRT client-bridge but it can be useful to set the time for cron jobs or logging. In this case DNS lookup, and even entering an NTP server’s IP address, fail. You can set time manually but on any reboot, date is reset to midnight Thursday Jan 1 1970.

This simple solution uses that date and cron to set the clock.

  1. Check the timezone and set it correctly. It can be viewed and set in the web interface or SSH
  2. Disable the NTP client in the web interface.
  3. Enable cron in the web interface and add this task, replacing the host IP with that of a suitable NTP server.
    1 0 * * 4 root /usr/sbin/ntpclient -h 192.168.1.31 -s
  4. Reboot

This will set the time at 00:01 every Thursday, or in other words 1 minute after any reboot and once a week thereafter. That’s sufficient for me but you can obviously adapt ntpclient options or add additional cron jobs.