OpenWrt Forum Archive

Topic: Keeping correct time

The content of this topic has been archived on 25 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

How does OpenWrt maintain the correct time?

I just noticed that my system's date is 27th Feb.... but it's 4th Mar.

The system was rebooted a couple of hours ago.

I think time synchronization using the NTP client is enabled by default. It's configured on the System page in luci. (The server candidates are x.lede.pool.ntp.org, where x=0,1,2,3.)

When the router cold-boots, the time starts from the latest file timestamp in /etc

Once the router has connectivity,  NTP should set the correct time from internet

You need:

  • NTP servers configured in OpenWRT

  • NTP client mode enabled

  • A route to the desired NTP servers

  • Firewall rules which permit NTP traffic

Out of the box, OpenWRT is configured as a DHCP client on the WAN interface, and allows all outbound traffic from itself to the WAN, so all of the above dependencies are satisfied.

However, if you've configured OpenWRT with potentially overlapping subnets, or to use its LAN port for outbound traffic, then you may need to revisit your OpenWRT box's configuration.

How do I configure OpenWrt, using ssh, to use 192.168.1.1 as its NTP server?

Thank for that. It's working as I wanted now.

I guess it didn't work previously because hostnames were not getting resolved.

The discussion might have continued from here.