You are not logged in.

#1 2015-07-25 18:01:33

Median
Member
Registered: 2011-06-03
Posts: 60

Automatically restart openvpn service after switching to another net?

Hi,

Currently when I switch connections from wired to wireless, or from one wireless network to another, my OpenVPN service will stop working until I restart it manually, and this of course results in a broken net until it's fixed. Is there a way to automatically restart the OpenVPN service each time I switch network? I'm using connman to handle my connections at the moment.

Thanks for any help!

Offline

#2 2015-07-28 14:36:32

CyberGhost
Member
Registered: 2015-06-01
Posts: 9

Re: Automatically restart openvpn service after switching to another net?

You could this solution from this openSUSE forum post
Add this to the OpenVPN service file after the "ExecStart" line:

Restart=always 
RestartSec=30  

Offline

#3 2015-07-29 14:12:22

Median
Member
Registered: 2011-06-03
Posts: 60

Re: Automatically restart openvpn service after switching to another net?

CyberGhost wrote:

You could this solution from this openSUSE forum post
Add this to the OpenVPN service file after the "ExecStart" line:

Restart=always 
RestartSec=30  

I already had that option in the service file, but unfortunately it doesn't work. I might have found my answer in the thread though: "I suppose it may make a diff what type of Internet connection interruption, but if I'm connecting through the same AP (ie same network credentials) the session is momentarily uninterrupted, I speculate because openVPN is an HTTP technology which is fundamentally based on individual asynchronous connections compared to other types of VPNs.

If the network changes too much, re-make the connection completely generating new authentication tokens, then of course that would require much more than simply re-establishing the existing session."

I guess I will need to continue manually restarting the connection until I find another solution.

Offline

Board footer

Powered by FluxBB