vpn on/off switch

Is there any software/script that blocks all internet traffic if it's not going through openvpn or pptp? I'm looking for something simple that I could switch on and off whenever I need it.
Who is Participating?
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
That message only appears if you do not have a default gateway. But the issue is - you can't get to the VPN server, if it is not on LAN, and you haven't any specific routes for the VPN server IP set!

OpenVPN can set the routes on connection. See the redirect-gateway directive.

If you want to do it manually, you should add and change the default route:
   2>nul route add mask Ip.Addr.of.Gateway
   2>nul route change mask IP.Addr.of.Gateway
The 2>nul will prevent errors from being shown.
Take a look at -
VPNCheck: http://www.guavi.com/vpncheck_free.html
VPN LifeGuard: http://en.kioskea.net/download/download-11960-vpn-lifeguard

One of those should be what you're looking for.

11friendAuthor Commented:
Thanks. Do you know other solutions? The second software isn't in English and the first one doesn't work properly on my computer despite great effort from the author to help.
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
I might think too simplistic, but if you do not use a default gateway while not connected, you cannot have Internet traffic ... While on PPTP/OpenVPN, just have the default gateway added.
11friendAuthor Commented:
That would be probably the best solution but I don't know how to do this exactly. I found something here http://www.experts-exchange.com/Networking/Wireless/WLAN/Q_22619759.html but I get a message that my route can't be changed.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.