[SOLVED] Prevent "normal" traffic if VPN disconnects ?

Started by adrianTNT, February 18, 2015, 04:14:44 PM

Previous topic - Next topic

adrianTNT

Is there a way to prevent normal traffic if the VPN connection stops for any reason?
Now it seems to continue normally if the VPN connection stops.

ZEROF

#1
Hi,

You will need to set iptables rules or write some bash script to check if openvpn is up or not, then kill network manager if not connected to VPN.

Something like: http://forums.debian.net/viewtopic.php?f=10&t=108381#p517286

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

adrianTNT

Hello again ZEROF.

I managed to write a quick PHP code that checks for the country code of current IP and if not in list of my VPN countries then it makes a beep, but ...
what would be best command to kill the network ? Maybe something that will just allow me to start it later from top right task-bar.

ZEROF

#3
Best command, pff, you can use airmon-ng check kill, but you can use sudo service network-manager stop to be sure.

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

adrianTNT

After trying various things I found that best solution is to use the VPN client from the provider, it works nicely in both Backtrack, Windows, Android, very light weight, GUI. The key function of these apps is "Internet kill switch"  8)

The other methods seem hard to implement and unreliable, the simple PHP script for example blocked after too many "check network" loops.