GL-AX1800 after reboot VPN-wireguard does not work

Hi community, I'm facing a silly issue, I set a cronjob for rebooting the router each early morning, as I have the VPN client (wireguard) always on, managed by "policy on the client device" (by MAC); all devices selected to use the VPN don't get the VPN network until I reset (switch on/off) the VPN.

I tried by the following command:

/usr/sbin/dnsmasq -C /etc/dnsmasq.conf.vpn -x /var/run/dnsmasq/dnsmasq.v

But as you know from the GUI it does not get the notification that the service is up and it does not show it. So by the command above it's not a good solution.

I got the latest upgrade version on my GL-AX1800.

Hello,

  1. What is your VPN provider (or VPN server)?

  2. Please confirm whether the VPN Profile is invalid and needs to be reconnected manually to reconnect to the VPN server? Since probably the server IP has changed per day.

  3. Try to load this VPN profile on the PC "WireGuard" APP and connected to the VPN server to observe if it works over 1 day.

Hello,

  1. SurfShark
  2. VPN profile is valid no need any manual re-connection. But the only thing I remember now it's my Public IP provided by my ISP change by each restart....ummm but it may not related.
  3. Yes the profile provided Surfshark works as expected.

There is any option to set a kind of crontab restart for the Wireguard VPN ?

If setting a crontab to restart the WireGuard client, it seems to be a workaround method to avoid the issue, but we would rather understand the reason why it disconnects to solve this issue.

add on crontab: 0 */5 * * * /sbin/ifup wgclient, restart the "wgclient" interface every 5 hours.

When reconnection occurs, please export and share syslog to us.

In addition, is the ISP modem network normal when the VPN connection is abnormal?
For example ping www.google.com or ping VPN server IP/domain name on router SSH to check it out

Understood thank you Bruce, I set /sbin/ifdown wgclient and then a /sbin/ifup wgclient within 2h different, on my case I set those cronjobs for tomorrow morning after the reboot, and I will check out the logs, sorry for these days are been busy for me.

Regarding the troubleshooting when VPN is abnormal, I'll do it tomorrow and later share you the logs, again sorry for my late response.

Regards

hi bruce,

I'm been troubleshooting the issue day by day, and as you say and I'm been thinking, itś pretty strange that situation with wgclient, even with the ifup/ifdown command...so I noticed the following command set on my startup script:

. /lib/functions/gl_util.sh
remount_ubifs

/bin/sed -i '/config redirect '''dns_vpn_guest'''/,/option enabled/ s/option enabled '''1'''/option enabled '''0'''/' "/etc/config/firewall"

/bin/sed -i '/config redirect '''dns_vpn'''/,/option enabled/ s/option enabled '''1'''/option enabled '''0'''/' "/etc/config/firewall"

exit 0

so I commented those two, being honest I do not remember when/why I set them...I restart the router and the issue solved.

Thank you for your comment, and share to you all that this product/service you're offering it's pretty amazing guys, I'm really happy with the community, cheers ! and have a good hack-code weekend

1 Like