Bypass VPN for a specific website / ip address

Although you may be using a VPN to mask or anonymise your real IP address there can be occasions when you still need to use your real ip address. Indeed some websites or services will detect your IP is part of a VPN and block your access.

This is really easy to achieve and can be enabled / disabled on the fly or permanently within Windows.

First, you’ll need the default gateway ip address of your lan, typically your routers address. You can get this by opening a command prompt and typing.

ipconfig

Secondly you’ll need to know the ip address of the website that you want to access using your real IP address.

You can get the ip address of the website that you want to create the exception for by typing the following in a command prompt

ping www.thewebsite.com

Finally, you will need the interface number of your network card, you can get this by typing the following into a command prompt.

route print if

Now, you’ll need to open an elevated command prompt (open the command prompt as Administrator). You then type the following command to add your website exception. I have assumed here that my network card has an interface number of 5, please change yours accordingly.

route add ipofwebsite MASK 255.255.255.255 defaultgateway if 5

example

route add 200.200.5.10 MASK 255.255.255.255 192.168.1.1 if 5

To delete this or any other exception simply type the following

route delete ipofwebsite

example

route delete 200.200.5.10

This assumes that you are wanting to allow a specific known IP address though your VPN.

If you want to allow a range or wildcard such as 200.200.0.xxx the use the following:
The 0’s at the end of the IP range and subnet mean include everyting from 1 – 254

route add 200.200.5.0 MASK 255.255.255.0 192.168.1.1 if 5

These exceptions will be lost when you’re device reboots, to make the rule permanent use the -p command

route -p add ipofwebsite MASK 255.255.255.255 defaultgateway if 5

To check what routes have been added use the following command

route print
Print Friendly, PDF & Email

More Like This


Categories


Windows

Tags


  • Post a comment