Jump to content

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

Rate this topic


Recommended Posts

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


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

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


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.

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.

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.

  • Create New...