DDWRT Losing Time Of Day (TOD)

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page 1, 2  Next
Author Message
gil_happy
DD-WRT User


Joined: 24 Sep 2009
Posts: 139

PostPosted: Mon Jun 25, 2018 23:08    Post subject: DDWRT Losing Time Of Day (TOD) Reply with quote
Hello, with the great help of everyone, I previously setup a VPN solution between 2 locations and it has mostly been working great. Here are the threads:

- https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=307318&highlight=
- https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=313143&highlight=

The problem is that the 'Primary Home (router2)' keeps losing it's time of day (TOD). When I telnet to 192.168.1.2 and type the 'date' command, I see that it is 'Jan 1970'. Because of this, my VPN stops working. Rebooting or resetting the router seems to fix the problem. From the uptime of the router, I can see that the router has been up for approximately 7 days, and has lost its TOD at some point.

Does anyone know how to fix? The 'Primary Home (router1)' does not have a problem and never loses its TOD. I have attached a screen shot from 'Primary Home (router2)' with the network settings.

Thanks in advance!
Sponsor
gil_happy
DD-WRT User


Joined: 24 Sep 2009
Posts: 139

PostPosted: Tue Jun 26, 2018 13:33    Post subject: Reply with quote
Thanks very much for this info eibgrad... a couple of things; on the affected router (Primary Home router2), I am not using the WAN port - only the LAN port (LAN to LAN). Also, per your suggestion in the original thread, we selected the option to 'assign the WAN to the LAN'. Knowing this information, do you suggest, or rather, will the script work?
gil_happy
DD-WRT User


Joined: 24 Sep 2009
Posts: 139

PostPosted: Tue Jun 26, 2018 13:52    Post subject: Reply with quote
eibgrad wrote:
The script is NOT dependent on having an active WAN. It's only dependent on having internet access on that device. And that's possible in a bridged (LAN to LAN) configuration so long as you specify a gateway IP and DNS server in the Router IP section. When the WAN is disabled, the router no longer has access to those settings from the upstream router, so *you* have to make sure to provide them. And at least according to the image you posted, it appears you have. Which begs the question, then why isn't it updating the date/time? As I said, I have seen this before, but I'm just not sure why things go wrong. So the script may help.


Thank you... I will try the script on Friday once I'm back in front of the routers.
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6445
Location: UK, London, just across the river..

PostPosted: Tue Jun 26, 2018 14:55    Post subject: Reply with quote
well i tried this script instead Razz and on my R7800 & R7000 it gets stuck by connecting to NTP server, tried with few others but no avail..no internet access at all..
do i have to disable the GUI NTP option first...??
also they are 2 scripts so its better to do them one by one via CLI otherwise copy paste its funny but i guess it works,
could you do it via GUI commands field ? (have to remove all "")....
i do have a jffs on NTFS USBflash drive and i can see this file created and can edit it with vi....

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
gil_happy
DD-WRT User


Joined: 24 Sep 2009
Posts: 139

PostPosted: Thu Jun 28, 2018 16:08    Post subject: Reply with quote
As mentioned in my last post, I hope to try the script tomorrow afternoon sometime. Also, in my original post, I didn't mention I have the NTP client enabled (see attached pic). I'm not sure if this could be part of the problem? Meaning, should I try disabling this for a couple of weeks 'before trying the script' to see if I still lose TOD with the NTP client disabled?
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6445
Location: UK, London, just across the river..

PostPosted: Fri Jun 29, 2018 4:50    Post subject: Reply with quote
i can tell you that something is not wright with your setup just by looking at this picture posted...
also stop asking a questions that nobody can answer...
its you to test and report....

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
gil_happy
DD-WRT User


Joined: 24 Sep 2009
Posts: 139

PostPosted: Fri Jun 29, 2018 21:46    Post subject: Reply with quote
Ok, after trying out the script this afternoon, it does not appear to work. With the script in place, and even after rebooting the router, the date on the 'PHrouter2' shows Dec 31, 1969 (previously, if I just rebooted the router with no script, it would update the time to the current TOD for a short period of time). Here is what I did:

- first, I went into the web GUI (Setup, Basic Setup), and disabled the NTP client. As mentioned initially, the NTP client has always been enabled.
- then went into Administration, Management and enabled JFFS2 Support (enable 'Internal Flash Storage'). I also enabled the 'Clean Internal Flash Storage' per the wiki (https://wiki.dd-wrt.com/wiki/index.php/Journalling_Flash_File_System)
- I also changed the NTP server from 'time.apple.com' to 'pool.ntp.org'

A couple of things:

- how does the script know about the time offset?
- also, from looking at line 18 and 20, since in the original solution, this device never gets a WAN IP address (this is part of the working solution provided), it seems like this script will never work. When I type 'nvram get wan_gateway' from the CLI, it returns 0.0.0.0.
tatsuya46
DD-WRT Guru


Joined: 03 Jan 2010
Posts: 7568
Location: YWG, Canada

PostPosted: Fri Jun 29, 2018 21:56    Post subject: Reply with quote
known issue, ddwrt cant handle setting a date/time manually, it depends on having wan. dont ask why.
_________________
LATEST FIRMWARE(S)

BrainSlayer wrote:
we just do it since we do not like any restrictions enforced by stupid cocaine snorting managers

[x86_64] Haswell i3-4150/QCA9984/QCA9882 ------> r55797 std
[QUALCOMM] DIR-862L --------------------------------> r55797 std
▲ ACTIVE / INACTIVE ▼
[QUALCOMM] WNDR4300 v1 --------------------------> r50485 std
[BROADCOM] DIR-860L A1 ----------------------------> r50485 std


Sigh.. why do i exist anyway.. | I love you Anthony.. never forget that.. my other 99% that ill never see again..

Malachi
DD-WRT Guru


Joined: 17 Jul 2012
Posts: 7209
Location: Columbus, Ohio

PostPosted: Sat Jun 30, 2018 0:41    Post subject: Reply with quote
Smaller pictures please.
_________________
I am far from a guru, I'm barely a novice.
mrjcd
DD-WRT Guru


Joined: 31 Jan 2015
Posts: 6291
Location: Texas

PostPosted: Sat Jun 30, 2018 21:25    Post subject: Reply with quote
I have 7 dd-wrt devices connected to my main network that are up 24/7.
Ranging from EA8500, WNDR3700v4, WNR2000v3, E2100L units + WRT54G & WAP54G units.
They all have WAN disabled & DHCP disabled but have main router IP as gateway.
NTP Client is enabled.
Time Zone is set correctly.
Server IP/Name is left blank (dd-wrt built-in works fine).
They all keep correct time and have for very long time, several years Smile
gil_happy
DD-WRT User


Joined: 24 Sep 2009
Posts: 139

PostPosted: Sun Jul 01, 2018 15:08    Post subject: Reply with quote
mrjcd wrote:
I have 7 dd-wrt devices connected to my main network that are up 24/7.
Ranging from EA8500, WNDR3700v4, WNR2000v3, E2100L units + WRT54G & WAP54G units.
They all have WAN disabled & DHCP disabled but have main router IP as gateway.
NTP Client is enabled.
Time Zone is set correctly.
Server IP/Name is left blank (dd-wrt built-in works fine).
They all keep correct time and have for very long time, several years Smile


Thank you... I will try on Tuesday and see if this works.
gil_happy
DD-WRT User


Joined: 24 Sep 2009
Posts: 139

PostPosted: Sun Jul 01, 2018 15:10    Post subject: Reply with quote
tatsuya46 wrote:
known issue, ddwrt cant handle setting a date/time manually, it depends on having wan. dont ask why.


Unfortunately I am not setting the date / time manually. This device appears to lose its NTP time / date after a short period of time (maybe a week or so).
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6445
Location: UK, London, just across the river..

PostPosted: Mon Jul 02, 2018 4:49    Post subject: Reply with quote
gil_happy wrote:
tatsuya46 wrote:
known issue, ddwrt cant handle setting a date/time manually, it depends on having wan. dont ask why.


Unfortunately I am not setting the date / time manually. This device appears to lose its NTP time / date after a short period of time (maybe a week or so).



well, forgive me if im wrong but, did you start with telling us what is your device (brand) and current build running at the first place...
update to a new build...and try again
do a reset before and after and try again
do no restore settings from files especially from different builds
do manually edit and put your settings after update...
just use the NTP server setting on DD-WRT its working on the last builds
or set a IP to fetch the time...google NTP 216.239.35.4

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
gil_happy
DD-WRT User


Joined: 24 Sep 2009
Posts: 139

PostPosted: Mon Jul 02, 2018 12:37    Post subject: Reply with quote
Alozaros wrote:
gil_happy wrote:
tatsuya46 wrote:
known issue, ddwrt cant handle setting a date/time manually, it depends on having wan. dont ask why.


Unfortunately I am not setting the date / time manually. This device appears to lose its NTP time / date after a short period of time (maybe a week or so).



well, forgive me if im wrong but, did you start with telling us what is your device (brand) and current build running at the first place...
update to a new build...and try again
do a reset before and after and try again
do no restore settings from files especially from different builds
do manually edit and put your settings after update...
just use the NTP server setting on DD-WRT its working on the last builds
or set a IP to fetch the time...google NTP 216.239.35.4


No problem.. I didn't specifically provide this information, however here is the info:

- device brand = Linksys WRT1900AC
- current built = r34080 (Dec 14/17)
- are you saying to perform a factory restore before and after upgrading to a newer firmware version? If you are, I'm not sure I'm ready to upgrade just yet as I have done a lot of configuration to the VPN router in my home. I'll probably try the other suggestion(s) first before upgrading.

Thanks
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6445
Location: UK, London, just across the river..

PostPosted: Tue Jul 03, 2018 5:12    Post subject: Reply with quote
- device brand = Linksys WRT1900AC
- current built = r34080 (Dec 14/17)

there you go...so for Marvel devices ask and look here
https://forum.dd-wrt.com/phpBB2/viewforum.php?f=58

34080 is build with NTP time issues i guess you'd need to update to a new build and try again...
do keep in mind you may have to generate new VPN key if there are
updates on VPN module too or to read about any related issues according the build you installed , so stick to the new build threads read and try...

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum