VPN kill switch that aims to prevent network traffic through anything other than specified interface. Tested on Ubuntu 17.10 using Mullvad VPN. Inspiration and approach.
This VPN kill switch was not created by a security expert, nor can I guarnantee no leakage of anything. Use at own risk!
To run program, use killvpn --config /path/to/config.json enable/disable
.
Download, make build
, move to desired location.
It's possible to have this run at boot etc. using systemd.
A systemd service file can be seen in systemd/killvpn.service
.
See killvpn.json
for configuration example.
VPNhosts
is an array with hostnames and ports.VPNdevice
is the network device to be used with VPN. Checkifconfig
.NetworkDevices
is an array of network devices. Ex, eth0 for LAN and wlan0 for WLAN. Checkifconfig
.LocalNetworks
is an array of local area networks that should work. Can be an IP address or IP/subnet mask.VPNapps
lists all apps that are NOT suppose to be running without VPN.Verbose
true / false.