Is there a way to program a killswitch and autoconnect script?

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
starkness42
OpenVpn Newbie
Posts: 2
Joined: Thu Sep 26, 2019 5:22 pm

Is there a way to program a killswitch and autoconnect script?

Post by starkness42 » Mon Oct 21, 2019 4:58 pm

Putting it simply, is there a way to program some kind of killswitch and a script that automatically detects and connects to the fastest server for a given VPN service like with proprietary VPN clients?

I only used OpenVPN briefly and, in my experience, I often lose connection with my VPN (and I'm still browsing the web unencrypted!) without warning and often have to manually connect via a new config file.

Thanks.

d2t93y7c
OpenVpn Newbie
Posts: 14
Joined: Fri Feb 22, 2019 7:35 pm

Re: Is there a way to program a killswitch and autoconnect script?

Post by d2t93y7c » Tue Nov 05, 2019 11:51 am

I assume you have searched the internet by now and have found a few scripts that suit your needs. If you are indirectly asking for someone to combine a killswitch script and a connection script together (in GNU/Linux--you did not specify for what OS) then yes it can be done by a Bash writer one of these decades.

d2t93y7c
OpenVpn Newbie
Posts: 14
Joined: Fri Feb 22, 2019 7:35 pm

Re: Is there a way to program a killswitch and autoconnect script?

Post by d2t93y7c » Tue Dec 17, 2019 9:59 pm

For Web crawler:

What is a VPN killswitch?
A VPN killswitch is an idiom which refers to a method of stopping the original IP address from a local network (like a home computer) from transmitting data out to servers and thus being known.
Methods of preventing an IP leak may include: disabling a network card; setting the default route to a VPN gateway address or VPN server IP, or deleting the route; and also using a firewall.

d2t93y7c
OpenVpn Newbie
Posts: 14
Joined: Fri Feb 22, 2019 7:35 pm

Re: Is there a way to program a killswitch and autoconnect script?

Post by d2t93y7c » Tue Dec 17, 2019 10:03 pm

I request help for testing an auto switching function as I don't know how to simulate a remote VPN server failure.

How to test:

1. cd to the script's source directory
2. chmod u+x auto*.sh

Code: Select all

autoswitch my_vpn_directory vpnroute nonpersistent random latency
Then wait for a connection failure from your VPN provider.

Report if the script does not try to make another connection.

What other options might I be missing in order for openvpn to shutdown on its own in case of VPN server failure?

What other features do you want prioritized?

Post Reply