Using OpenWrt for VPN on second router: Random Connection drop

I am using a dual router setup with a primary ISP router and a secondary OpenWrt VPN router. Although the internet works well on the secondary router most of the time, the connection drops on VPN router sometimes while still active on ISP router. The configuration settings are as follows. Please let me know if I need to change anything in the configuration to fix the random internet drop of the VPN router.

I am using my ISP router with the following settings:

IP: 192.168.0.1
Subnet: 255.255.255.0
DHCP Enabled
DHCP Server Starting IP address: 192.168.0.50
IP Pool Count: 50

I added Archer C7 as second router to my primary ISP router with the following settings:
On your VPN router LAN settings please configure the following:

IP: 192.168.1.1
Subnet: 255.255.255.0
DHCP Enabled

The DHCP settings are as follows.

The WAN settings on OpenWrt are as follows.

IP: 192.168.0.2
Subnet: 255.255.255.0
Default Gateway: 192.168.0.1

Although the internet and VPN works okay on VPN router most of the time, the internet drops sometime on the VPN router. Could you please share if I have missed any configuration step?

Could it be that the VPN tunnel is going down?

The details you have provided so far won't help, though -- DHCP settings are almost certainly not the issue.

The logs may have clues, and of course the rest of the configuration will be necessary.

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Also include, as a separate section, the output of (try to find the time that the issue occurred and give us a snippet in the time immediately before and after the issue begins):

logread

Do you have also openvpn log from the client?

Yes, here you go. Thank you! I noticed the loss of internet on OpenWRT connection around 8:37.

2022-01-30 08:49:42 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 08:49:42 SIGUSR1[soft,ping-restart] received, process restarting
2022-01-30 08:49:42 Restart pause, 5 second(s)

[us8044.nordvpn.com] Inactivity timeout (--p

here we go.

Do you have the keepalive option https://superuser.com/questions/625721/how-to-keep-alive-the-vpn-connection on the server config?

Thank you, I will try and report.

You can prevent it by pinging the openvpn server ip address from the client every 2 minutes. You can do this via cronjob on the openwrt router. This will basically do the same thing as the keepalive openvpn option.

Thank you, I added the keepalive script to NordVPN UDP config file. However, the same thing happened. Here is the log. Anything else should I try? Thank you!

2022-01-29 12:18:47 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-29 13:32:41 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-29 13:37:30 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-29 13:48:44 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-29 13:53:30 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-29 16:43:18 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-29 20:26:30 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-29 21:02:35 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-29 21:41:27 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-29 22:31:21 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-29 22:50:36 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 00:01:55 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 00:26:24 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 00:50:30 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 01:03:44 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 01:50:27 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 02:04:20 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 02:30:05 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 03:19:12 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 03:54:53 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 03:59:12 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 08:49:42 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting
2022-01-30 18:58:57 [us8044.nordvpn.com] Inactivity timeout (--ping-restart), restarting

The keepalive option must be supported by server, e.g. your vpn provider, but you can have a script with pinging the openvpn server through the internal encrypted channel to keep the connection alive. I would add this script to the cronjob.

Script:

#!/bin/ash
ping -c 1 server_ip_address

cronjob:

*/2 * * * * /path/to/script.sh 1> /dev/null 2> /path/to/script.err