Intermittent VPN Issues

Ah OK you are already using PBR.

In that case set the clients you do not want to use the VPN to use the WAN but it seems you already did :slight_smile:
But more important update your WireGuard Watchdog script with my new script and do not restart the network that should hopefully do it

1 Like

Thank you again for all your help!

1 Like

I just wanted to pop in and add that I did fix my intermittent VPN disconnects. Although your script has been helpful, the main reason why the VPN kept dropping was because "MSS clamping" was not checked in my "vpn" zone in the Firewall settings. (An oversight on my part) Things seem to be working as they should now. It's been about two days without any disconnects.

@egc Your script is still working fantastic! But I have one small question about it since I commented out the "Restart Network" string.

Each time the interfaces change, my public IP switches for all devices connected to the VPN which is expected, but the few items I have on PBR (mainly the smart TV) doesn't route them off the interface correctly and they show the public IP show by Proton which causes all streaming services to complain. The only way I have found to fix this is to manually restart the WAN each time one of them complains. Is there any way to prevent this from happening or force PBR to kick start once an interface has been switched?

Perhaps add service restart pbr to the script?

Thanks, I'll give this a shot! Does adding it to the end of the script like this work?

No that will not work, try to add it after ifup "$wg_activetunnel"

	# Restart whole network or only start new WireGuard interface
	if [[ ${RESTARTNETWORK+x} ]]; then
		echo "WireGuard watchdog: restarting network"
		service network restart >/dev/null 2>&1
	else
		echo "WireGuard watchdog: starting WireGuard interface $wg_activetunnel"
		ifup "$wg_activetunnel"
		service pbr restart               <<<<<< ADD
	fi
	sleep 10

Perfect, thanks for your help. I'll let you know how I turn out!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.