Skip to content

VPNKillSwitch works on Debian systems, including Raspberry Pi (Raspbian). The service will keep your OpenVPN client connected and prevent data transmission if connection to the VPN is lost.

Notifications You must be signed in to change notification settings

nickramsbottom/vpnkillswitch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VPNKillSwitch

VPNKillSwitch is a script that can be run on a schedule using cron (see below for my implementation). It determines if (1) OpenVPN client is still connected, (2) if an internet connection is active, and (3) if the IPTables firewall rules are configured properly such that if VPN connection is lost, no data is sent or received. If any of the 3 tests fails, then the script will attempt to reconnect the client to the VPN and reconfigure the IPTables firewall rules.

The Wiki provides better instructions on the aforementioned configuration.

Running Script with Cron

In Debian 8.x edit the crontab file with the following command: nano /etc/crontab

Add the following line to the end of the file:

*/1 * * * * root /usr/vpnkillswitch/vpnkillswitch.sh

Change the path of vpnkillswitch.sh as needed.

This will run the script once every minute.

About

VPNKillSwitch works on Debian systems, including Raspberry Pi (Raspbian). The service will keep your OpenVPN client connected and prevent data transmission if connection to the VPN is lost.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 87.3%
  • Python 12.7%