How can I make the Windows VPN route selective traffic (by destination network)?
You can turn off taking over your entire connection by going to the properties of the VPN, Networking
tab, Internet Protocol (TCP/IP)
properties, Advanced
, untick Use default gateway on remote network
. This may or may not leave a route to 192.168.123.0/24
depending on the VPN server's setup. If it doesn't, you'll have to manually add the route each time, although you could put it in a batch file.
In order to manually add the route, run (as administrator):
route -p add 192.168.0.12 mask 255.255.255.255 10.100.100.254
This example will make a persistent (it's not necessary to run the command after a reboot) route to the IP 192.168.0.12
through the VPN gateway 10.100.100.254
.
More about this at http://technet.microsoft.com/en-us/library/bb878117.aspx
I successfully used @TRS-80's technique to achieve this.
I work from home and have to VPN onto the corporate network for my email (I hate webmail!!).
At the same time, I need to be constantly surfing for info and also need youtube for my background music... Now you definitely don't want to stream youtube off a VPN since that makes it sound like a Robot Singing!!! :)
All I did was follow @TRS-80:
properties of the VPN, Networking tab, "Internet Protocol (TCP/IP)" properties, Advanced, untick "Use default gateway on remote network"
and then did my own:
under DNS tab, tick "register this connections addresses in DNS"
All works seamlessly!
Use Add-VpnConnectionRoute cmdlet in Windows 8+.
Add-VpnConnectionRoute -ConnectionName 'My VPN Connection' -DestinationPrefix 192.168.123.0/24