Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using a VPN on my PC and I want to limit ALL the internet connections on my PC to go through the VPN, if the VPN gets disconnected I want all my applications to go offline.

How can I accomplish that?

share|improve this question
    
Answered, and oh yeah, belongs on superuser –  MikeyB Sep 6 '09 at 17:53

2 Answers 2

You need to configure a little custom routing on your PC.

Change your local area network settings so that you don't use the local default gateway. After doing this, no applications will be able to access the Internet.

Then, configure a route to your VPN server's IP via your local gateway. Now you'll be able to hit only the VPN server across the Internet.

Then, setup your VPN connection to set your machine's default gateway when it's up.

Now, when your VPN goes down, you won't have a default route to the Internet, so packets will stop going out.

share|improve this answer

In the advanced TCP/IP properties of the VPN connection, check the "Use default gateway on the remote network" flag; this will route all traffic through the VPN.

If the VPN gets disconnected, the system will resume standard operation and use its primary Internet access; this can't be avoided: if the system couldn't have Internet connectivity without the VPN, it wouldn't be able to establish the VPN connection itself.

share|improve this answer
    
The description says that when it's checked data isn't sent on LOCAL NETWORK, what I was is when I'm not connected to the VPN my web browser, ftp program, voip application, bittorrent etc. won't work. –  Blake Sep 6 '09 at 12:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.