Hi, i'm using OpenWrt 18.06.2 on netgear r6220 router. I'd like to synchronize its time with my laptop, because when i boot my device it wont get internet access before it has proper time(I use wireguard so that everything is blocked before its up). So I have to manually log into luci and synchronize clock with browser. This is not a big problem to me.
I've set my laptop to act as ntp- server(and set my firewall settings) and on my router I'd like to use like: ntpd -p , but is has no effect. My laptop is on the same lan as router.
I tried to create a static route to my local machine but it caused luci to freeze and couln't access anymore to it via luci or ssh. (Internet, however was up also after restarting my router on normal mode?) So I used filesave mode and reverted changes. I surely don't understand enough on this sort of things. Next time I'll look at a router that has a hardware clock to avoid this problem.
First on my router I set my time a bit backwards using date command. Then tried to correct it using ntpd -p my-local-machine-ip. This didn't change my system time. I had set my laptop as a server before that using luci.
Sorry I remember wrong. I actually did this before. I also set my windows laptop to run as ntp server.
To get time I use luci's 'sync with browser' button.
Thanks for your advice. I'll look at that creating route method. At this time it's enough for me that I can sync the time via browser.
I got the time syncing by adding a few routes to ntp-servers on internet. Wireguard works now automatically after booting. Thanks @lleachii!
I cant find any evidence that my router has an internal RTC. In kernel log is says somethin like:
[5.319240] hctosys: unable to open rtc device (rtc0)
Didn't find any rtc module or configuration files installed.