Set router time using personal computer time?

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
leaf27
DD-WRT Novice


Joined: 16 Sep 2021
Posts: 38

PostPosted: Wed Nov 17, 2021 2:24    Post subject: Set router time using personal computer time? Reply with quote
My router time goes to 18:00 periodically and the internet connection is lost. My NTP Client is setup correctly as instructed from the forum. I can set the time manually, but most of the time I have no time problems. Is there a way for the router to check the time using my computer as a fallback?
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Wed Nov 17, 2021 3:21    Post subject: Reply with quote
What happens if your local PC time goes haywire? It would be good to figure out why your router time goes askew, but "My NTP Client is setup correctly as instructed from the forum." doesn't really give details as to exactly how your router is configured. Pictures and details are a wonderful thing to have to help aid in troubleshooting.

Anyhow, to facilitate using a local PC to serve as a time server...

https://www.interfacett.com/blogs/creating-standalone-ntp-server-windows/

https://www.tutorialspoint.com/how-to-install-and-configure-an-ntp-client-and-server-on-linux (RedHat-based using yum)

https://www.ubuntu-server.com/ubuntu/how-to-setup-ntp-server-and-client-on-ubuntu/

https://www.tecmint.com/install-and-configure-ntp-server-client-in-debian/

https://vitux.com/how-to-setup-ntp-server-and-client-on-debian-10/

http://bensoftware.com/blog/running-an-ntp-time-server-on-your-mac/

You would have to add your PC's IP address and another IP address in the textbox on the main setup page, though.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
leaf27
DD-WRT Novice


Joined: 16 Sep 2021
Posts: 38

PostPosted: Mon Nov 22, 2021 21:40    Post subject: Reply with quote
Thanks for those links. That is helpful. My PC is an Ubuntu Linux NUC from System76 in Colorado, USA and it has never had a time issue. It would be good to figure out why the router has a time issue sometimes. It doesn't happen all the time. When it does, it keeps resetting to 18:00:00 and can keep that up for a few hours. Then, it just keeps time for awhile with no issues. I'll keep an eye on it. Thanks again for your links! Very Happy
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Mon Nov 22, 2021 22:08    Post subject: Reply with quote
You think you have setup NTP correctly but maybe it is not?

To setup correctly you only have to set the time zone and leave the Server IP/Name blank.

The ntp daemon will check time every hour.
You can check syslog if this works.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
leaf27
DD-WRT Novice


Joined: 16 Sep 2021
Posts: 38

PostPosted: Fri Nov 26, 2021 22:44    Post subject: Reply with quote
Hi egc,

I'm using my router as a secondary router as Client with the primary router (internet access point).

I have only the time zone set and the IP address is empty as instructed on my secondary router. I still had problems earlier today. These time problems persisted for a couple of hours. At first, things work well, then things stop working. I have been checking the primary router Wifi connection with my phone and it still works fine.

I contacted my VPN provider about an unrelated issue and they gave me some additional configuration commands. These are not related to the time issue, but hopefully it will make my internet connection more stable in order to get the time.

When I was having the time problem, I reset to the correct time, then used the "Administration -> Commands" window and pinged 192.168.1.1 (primary router) with my secondary router (different IP address) and received an error message that it was unable to make a connection.

After I put the new configuration settings from the VPN company in (IP start address adjustment, DNS, maximum DHCP users, etc in the SETUP page) and repowered the router, I pinged the primary router again and received:

PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=16.547 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=5.059 ms
64 bytes from 192.168.1.1: seq=2 ttl=64 time=5.150 ms

--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 5.059/8.918/16.547 ms

I'll try the new adjustments for awhile and see what happens. Hopefully, the new settings will make a more stable connection. These new settings are much different than what I have read on any website or even the VPN providers site.

Thanks again and I will message back with a progress update later.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Sat Nov 27, 2021 17:07    Post subject: Reply with quote
We can tell more if we see the syslog.
It will tell what is happening.
It is possible the vpn goes down and if you have a kill switch set, the time can no longer be updated.

Just guessing Smile

Almost all vpn providers give old or even wrong settings.

See openvpn client guide link in my signature.

But as said we need to see syslog (from CLI: cat /var/log/messages ) and

I am also interested in the ovpn settings.
You can post screenshot of openvpn settings page, content of the additional config en screenshot of openvpn status page

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
leaf27
DD-WRT Novice


Joined: 16 Sep 2021
Posts: 38

PostPosted: Sat Nov 27, 2021 18:17    Post subject: OVPN and setup files for PIA VPN Reply with quote
The following files are being used with Private Internet Access VPN (PIA VPN). The VPN setup instruction were provided by PIA VPN.

The DD-WRT router is set up as a "Client" for a travel router and accesses the primary router (internet access point) wirelessly. The LOCAL IP ADDRESS of the DD-WRT router was adjusted to 192.168.3.1, but this can be changed to other IP addresses to make it different from the primary router. This also can help keep malware from attacking your router since some malware assumes 192.168.1.1 in some cases that I have read about.

If someone knows of a good DNS address besides Google, any suggestion is welcomed. I still would like to add a DNS 2 address. The suggestion address was 8.8.8.8 and I'm not using it for now.

I removed router name, username, and password but these need to be added by the router owner.

If there are any suggestions on how to make the settings better, any suggestions are welcomed. The settings are working well right now.

In order to see the files, you have to have an account on the DD-WRT forum.


Last edited by leaf27 on Sat Nov 27, 2021 18:25; edited 2 times in total
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Sat Nov 27, 2021 19:14    Post subject: Reply with quote
@leaf27 will look at it tomorrow
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087


Last edited by egc on Sat Nov 27, 2021 20:12; edited 1 time in total
leaf27
DD-WRT Novice


Joined: 16 Sep 2021
Posts: 38

PostPosted: Sat Nov 27, 2021 20:27    Post subject: Reply with quote
Hi egc,

No problem and it is the weekend. Thanks.
leaf27
DD-WRT Novice


Joined: 16 Sep 2021
Posts: 38

PostPosted: Sat Nov 27, 2021 20:39    Post subject: The route commands in the setup for PIA VPN Reply with quote
If anyone was curious where my IP routes came from in the additional configuration box of the VPN page, see the link below:

https://www.privateinternetaccess.com/helpdesk/guides/routers/dd-wrt2/dd-wrt-v40559-openvpn-setup

PIA has some special IP addresses that can help with privacy. The linked page also helps with basic setup.

The attachment files for my personal setup and also the PIA provided instructions in one of my previous posts in this thread has added the route commands not mentioned in other material I have read.

Right now, I get an (almost) instant connection to internet and VPN. There haven't been any time issues so far.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Sun Nov 28, 2021 8:19    Post subject: Reply with quote
Use ate least two DNS servers for Static DNS 1 and 2 on Setup page.

I use 1.0.0.1 and 9.9.9.9 but anything you trust is good

About the time setup, important leave the Server IP/Name field empty.

Check your syslog every hour and you should see the NTP client updating the time, but if your VPN is loosing its connection (which frequently happens unfortunately) time will not get updated.

About Setup:
This is a router in Gateway mode leave Gateway and Local DNS at their default 0.0.0.0

From the syslog I gather that this router is not connected via Cable but as Client mode setup:
https://wiki.dd-wrt.com/wiki/index.php/Client_Mode


About the VPN (I also reviewed your syslog) no real show stoppers.

But there is room for improvement Smile

Tunnel Protocol should be TCP4

Encryption Cipher and HASH Algorithm are not needed, choose Not set for these items

Set First Data Cipher AES-256-GCM, Second AES-128-GCM

Remove everything from the Additional config but probably keep:
pull-filter ignore "auth-token"

All other things are redundant and/or not needed

But add the following:
verb 5
keepalive 10 120
resolv-retry infinite
pull-filter ignore "route-ipv6"
pull-filter ignore "ifconfig-ipv6"

The extra routes are for DNS servers.
DDDWRT does that automatically besides they have 4 DNS server and you added routes for two but the one you got pushed is the .243

Just keep an eye on your syslog to see if the time is updating and if you are loosing VPN connection.

Sometimes connection loss happens with VPN's the only thing to do is to run a watchdog script which restarts the VPN or the whole router, explained in the docs.

Especially as this seems a router connected wirelessly which can be unstable, the use of a watchdog script with full reboot might be necessary to restore a dropped connection

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
leaf27
DD-WRT Novice


Joined: 16 Sep 2021
Posts: 38

PostPosted: Sun Nov 28, 2021 22:12    Post subject: Reply with quote
Thanks egc! I'm glad I asked for suggestions! The:

"This is a router in Gateway mode leave Gateway and Local DNS at their default 0.0.0.0 "

statement cleared up a question I had not asked. I don't have to worry about knowing the primary router IP address. I originally put that in there from some other reading material on how to set things up. Thanks for that suggestion to remove it.

I made the other changes like you recommended. The settings are definitely cleaned up and the VPN and connection in general is still snappy.

You mentioned that DD-WRT has four DNS addresses already. Can you send me a link that describes them in detail and what benefit they have? The PIA address 10.0.0.244 helps with privacy and security.

I will keep track of the syslog and time. So far, still no time issues.

I have backed up all these settings and will run with them from now on. Thanks again for your time and input with this. Have a good day!
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Mon Nov 29, 2021 11:32    Post subject: Reply with quote
leaf27 wrote:
Thanks egc! I'm glad I asked for suggestions! The:

"This is a router in Gateway mode leave Gateway and Local DNS at their default 0.0.0.0 "

statement cleared up a question I had not asked. I don't have to worry about knowing the primary router IP address. I originally put that in there from some other reading material on how to set things up. Thanks for that suggestion to remove it.

I made the other changes like you recommended. The settings are definitely cleaned up and the VPN and connection in general is still snappy.

You mentioned that DD-WRT has four DNS addresses already. Can you send me a link that describes them in detail and what benefit they have? The PIA address 10.0.0.244 helps with privacy and security.

I will keep track of the syslog and time. So far, still no time issues.

I have backed up all these settings and will run with them from now on. Thanks again for your time and input with this. Have a good day!


I meant PIA uses four DNS servers, but they always push one to your VPN client (you can see it on the OpenVPN status page or in the syslog:
Quote:
Nov 27 11:04:54 VWS345271 daemon.notice openvpn[2124]: PUSH: Received control
message: 'PUSH_REPLY,comp-lzo no,redirect-gateway def1,route-ipv6 2000::/3,dhcp-
option DNS 10.0.0.243
,route-gateway 10.57.19.1,topology subnet,ping 10,ping-
restart 60,ifconfi


In your case, at least when you connected that time (it can differ), they push the DNS server 10.0.0.243, of course it is up to DDWRT to actually use that DNS server and make a route via the tunnel for that DNS server (in case you are using Policy Based Routing)

Of course DDWRT takes care of that Smile

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
leaf27
DD-WRT Novice


Joined: 16 Sep 2021
Posts: 38

PostPosted: Mon Nov 29, 2021 15:37    Post subject: Reply with quote
Thanks egc for the explanation. I think the new settings are the best so far and I will keep running with them. Thank you again for your time spent looking at this. This R7800 router works great. Very Happy
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware 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 cannot attach files in this forum
You cannot download files in this forum