Jump to content
TorGuard
Chippyr

How can I route only traffic to a certain IP address through VPN?

Rate this topic

Recommended Posts

Chippyr

Hi. I am trying to leave most data untouched, but route certain IP addresses through VPN. How can I accomplish this? 
 

thanks

Share this post


Link to post
Share on other sites
kurisu

The TorGuard client permits split routing (so everything on your local network is still accessible) while everything going through your internet default gateway is pushed through the VPN.

 

You have a couple of options: alter the Windows routing table yourself, or install the OpenVPN client, generate an OpenVPN config for your TorGuard connection and modify the .ovpn config to accomplish your goal.

 

You can generate an OpenVPN config (TG web site -> Tools menu -> OpenVPN Config Generator, or https://torguard.net/tgconf.php?action=vpn-openvpnconfig) to use in the OpenVPN desktop client. Add in the lines

route-nopull
route 10.20.30.40 255.255.255.25

which will make the client ignore any 'pushed' routes from the VPN server and only add a route for traffic between you and 10.20.30.40 through the VPN gateway. Everything else will continue to go direct.

For larger blocks, e.g. the whole 10.20.30.0 block, the syntax is similar, using hostmasks:

route-nopull 
route 10.20.30.0 255.255.255.0

You can confirm using the various "route print" commands.

Alternatively, if it's just for one Windows machine, you can also achieve this by modifying the Windows routing table. More detailed steps here: https://superuser.com/a/457067/25193

Let us know how you get on.

 

You could also use Wireguard, where you can customise which networks should be handled by the VPN in a fairly easy manner. (Account -> Tools -> Enable WireGuard access). TG also support OpenConnect and STunnel, so you have multiple ways to tackle this problem.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...