Windows – How to configure Windows 7 routing table

vpnwindows 7

I know how to use hotspot shield or private VPN to use Pandora/Hulu outside of US. However, those VPN solutions route all traffic through VPN gateway. So even browsing a local site, the routing path is going through gateway in US, then back to my local destination site. How can I configure Windows 7 routing table to set traffic to Pandora/Hulu going through VPN gateway, where other traffic just use the original internet connection? I know in Windows Command Line Prompt, there is a tool – route which seems like it. But I don't know how to use it.

The other question is how to figure out what IP/subnet is related to Pandora/Hulu? I guess nslookup www.hulu.com is not sufficient since there may be some other host with different hostname belongs to hulu.

Best Answer

Yes, the first step is to identify the IP addresses you want to route - the actual routing is fairly straightforward.

When you are connected to the VPN and do

route print

It will show a default route, something like:

Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
      0.0.0.0          0.0.0.0        192.168.1.1     192.168.1.2     20

The IP address of the gateway and interface will be provided by your VPN provider at connection time.

The 0.0.0.0 destination and 0.0.0.0 netmask means "match all traffic to this route, and send it to the gateway"

You want to delete this, and replace it with a default route that is out of your internet connection. Like this (assuming 10.1.1.1 was your own router):

route delete 0.0.0.0 mask 0.0.0.0 192.168.1.1
route add 0.0.0.0 mask 0.0.0.0 10.1.1.1

Now all traffic will go out of your router, and none through the VPN.

Then you figure out the hulu network range - lets say it is 200.200.200.0/24, and add a route for it:

route add 200.200.200.0 mask 255.255.255.0 192.168.1.1

So what this is saying is, any traffic destined for any address in the range 200.200.200.0-255 should be sent to the VPN gateway.

Determining the hulu range might be difficult to deduce, but you could do some googling as you won't be the first to try and figure out what ranges they use. Failing that, you could install wireshark and observe what traffic flows through the VPN when accessing hulu (you'll want to make sure you don't run anything else at the same time).

Related Question