Douglas Crawford

Douglas Crawford

June 6, 2014

One of the (many) great strengths of VPN is that it encrypts a computer’s entire internet connection. This is great for security, but it can also be inconvenient at times, such when individual websites refuse to play ball with known VPN IPs (for example Hulu), or which block foreign IP addresses.

So wouldn’t it be great if we could bypass our VPN connection for specific websites? Well, fortunately we can, using static IP routing!

Unfortunately, bypassing complex websites that use multiple IP addresses is difficult using IP routing (our attempts to bypass VPN when running BBC iPlayer failed), but for simpler sites it works very well.

Windows manual method

1. Run cmd.exe:

  • Windows XP – Start -> Run -> type ‘command’
  • Windows Vista / 7 – Start -> All Programs -> Accessories -> right-click Command Prompt and choose ‘Run as Administrator’
  • Windows 8 – in Metro mode (Start Screen) click on ‘Apps’ -> type ‘cmd in the search box press enter -> when you see the cmd icon, right click on it, then right-click on ‘Advanced’ at the bottom right, and select ‘Run as administrator)
  • Windows 8.1 – Right-click Start -> Command Prompt (Admin)

2. Find out your gateway IP address (this is usually the IP address of your router).

  • Type ‘route print’ at the prompt and hit enter
  • Look under ‘Active Routes: Network Destination / Gateway for your gateway IP

windows manual 1

3. Find out the IP address of the website you want to bypass. As a test we will use, so visit it with your VPN enabled (it sgould show your VPN server’s IP address and location), then either:

  • Type ‘Ping’ at the command prompt

windows manual 2



4. At the command prompt type ‘route add [website IP] [gateway IP]’

e.g. ‘route add’

If you refresh/revisit you should now see your real IP address!

Windows UNrouting utility

VPN provider HideMyAss (HMA) provides a simple  tool that does exactly the same as above, but without the need of a command prompt. You will still need to establish your gateway IP address, however (see Steps 1 & 2 above).

The utility should be run as an administrator (right-click desktop icon and select ‘Run as administrator’). Note that this tool is a simple graphic interface (GUI) for performing the actions discussed above, and should therefore work with all VPN connections (not just HMA).


OSX manual method

This is very similar to the Windows manual method.

1. Open Terminal – Applications -> Utilities -> Terminal.

2. Type ‘netstat-r’ to see routing tables and establish gateway IP address (as Step 2 for Windows above).

3. Type ‘ping’ (for example) to find the target website’s IP address.

4. Type ‘sudo route -nv add [destinationIP] [gatewayIP] to add a routing rule

e.g. ‘sudo route -nv add


There are too many Linux distributions to cover here, but this article goes into detail on configuring static routes in Debian and Red Hat Enterprise Linux.


An Android device needs to be rooted to set up static routing rules, after which this can be done with any terminal emulator.

Type ‘su’ to get root privileges, and ‘ip route’ to show current routing rules. The article on Linux above explains how to set your own rules.

Our thanks to HideMyAss for providing the UNrouting utility, and much of the raw information in this article.


Douglas Crawford
March 12th, 2018

I am a freelance writer, technology enthusiast, and lover of life who enjoys spinning words and sharing knowledge for a living. You can now follow me on Twitter - @douglasjcrawf.

7 responses to “How to bypass VPN for specific websites

  1. thnx for the info..
    but it does not work in every website such as
    i want to bypass this web while connected to vpn.
    but it detects every time.
    give me the solution sir…..

    1. Hi Sanjay,

      As I note in the article, this method works well on simple websites, but can be confounded by complex ones. The only other solution that I am aware of is to run most internet connections from inside Virtual Machine (VM) with VPN installed, which allows you to access websites without the VPN using your regular OS. This has the advantage that the VM is isolated from the rest of your computer when (usually) browsing the internet, which will help protect your computer from viruses etc.

      Another possibility is to use an encrypted SOCKS5 proxy instead of VPN. Similar to VPN, this encrypts your internet connection between your browser and the proxy server, which also serves to shield your real IP address from the internet. SOCKS proxies are configured on a per-program basis, so you could configure one browser (e.g. Firefox) for secure connections, while using a second browser (e.g. Chromium) for ‘straight’ connections. More information on the difference between VPN and proxies can be found here.

    1. Hi Sofia,

      As I note in the article, ‘unfortunately, bypassing complex websites that use multiple IP addresses is difficult using IP routing (our attempts to bypass VPN when running BBC iPlayer failed), but for simpler sites it works very well.’

    1. Hi Matt,

      I’m glad you like it! I have started writing a series of how-to guides focused on using a Raspberry Pi as a VPN router or Tor node, the first of which should be published in the next day or so…

Leave a Reply

Your email address will not be published. Required fields are marked *