You are not logged in.

#1 2016-11-12 19:17:28

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

systemd module setup for reconnecting to VPNs after disconnect

I currently need to simultaneously connect to two different VPNs on my system. One using vpnc (my work one, for SMTP access) and one using openvpn. I currently have a script which manages this pretty well - connecting to my work VPN via vpnc and then removing it as the default and adding in only the routes I want to access via vpnc and then connecting to my other VPN via openvpn.

The issue is that my work VPN seems to kick me off after N hours (and sometimes the other VPN ceases to function).

What is the best way of automatically checking that (1) I'm still connected to each of the VPNs and (2) that I still have actual connectivity via the VPNs (e.g. that I actually can talk to the internet via my openvpn connection) and disconnecting and reconnecting if either of (1) or (2) is no longer true. I assume via a systemd module, but what should it look like?

Offline

Board footer

Powered by FluxBB