nm-l2tp / NetworkManager-l2tp

L2TP and L2TP/IPsec support for NetworkManager
GNU General Public License v2.0
489 stars 84 forks source link

Automatically reconnect when connection is lost #129

Closed cristobaltapia closed 4 years ago

cristobaltapia commented 4 years ago

Hi,

I have configured the VPN successfully and can connect to the VPN of my workplace. However, after a minute or so the connection is lost and have to manually reconnect. Is it there an option to automatically reconnect in such a case? I have searched for it, but could not find anything that would work for me.

dkosovic commented 4 years ago

You could use a script that makes use of the NetworkManager command-line interface, i.e. the nmcli command. For your refrence, common nmcli commands are:

Have a look at the following script, it should do what you want:

Should only need to change VPN_UID, LOG and CHECK_HOST in that script.

cristobaltapia commented 4 years ago

Thanks for that! I will try it.