I am using VPN service to access some work from abroad. Sometimes my VPN connection drops and my computer automatically connects to my local connection, which I do not won't as it immediately discloses my actual IP. The VPN service provider's support could not help me. Is there anyway to block my computer from reconnecting to my local connection?
To elaborate on Zoredache's answer, your problem can be solved by changing your routing configuration. I'll provide examples for Windows.
Step 1: Description and Default Gateway
Firstly, you need to determine your local connection's Description and Default Gateway. Open up a command prompt (
Note that if you are connecting to your ISP first, (Eg. via a PPPoE connection where you enter a username and password), you will need to look for something like
Step 2: VPN End Point IP Address
Next, you need your VPN end point's IP address. You mention that you use a VPN service provider. If your VPN connects to a hostname (Eg. vpn1.serviceprovider.com), you can determine the IP address by running
In this example, the VPN end point IP is 22.214.171.124.
Step 3: Interface Number
Lastly, you need your local connection's interface number. Run
The interface number is the first number on the line, and you need to find the line that has the same description as in our first step. In this example, Intel(R) 123BBQ Network Connection has an interface number of 11.
Setting It All Up
Once you have all this information, and after you are connected to your VPN, run the following in the command prompt:
This will remove the default route from your local connection, and replaces it with a single route directly to your VPN end point. Now, when your VPN connection drops, there is no route for traffic to reach the internet, so your IP address won't be exposed.
To restore your local connection's default route, you can run the following in the command prompt:
You may need to do this in order to reconnect to the VPN if your VPN connects to a hostname, or if you simply want to stop using the VPN.
If your VPN end point IP address never changes (Your VPN service provider may be able to tell you whether this is the case), you can even save the completed commands to files ending in
Remove the default route and create a route specifically to reach you VPN provider. The excact syntax is different for each OS. But it looks linda like this.