Before we begin, I must admit myself as more of a novice in the world of networking. Thank you.

I would like to send specific traffic through my VPN, through a local machine, or through WSL.

ie. Traffic via/related to google.com would go through a VPN (local machine, etc), BUT, amazon.com would still be unVPNed in whatever normal means.

I haven't found any sources that have described or shown or asked how to assign a specific IP or address to be redirected to a VPN. Maybe they are everywhere and I am just missing them, or I don't know how to ask for it correctly, or maybe it is something so basic I am missing it.

I thought I may have been able to find what ports certain website addresses attempt to access specifically, but if I understand correctly, ports are more like highways and allow multiple lanes of traffic to flow, so I would be rerouting an entire network as opposed to a single site/address. Maybe I am over thinking this, or going about this wrong.

I also went to check the settings within Mozilla and ProtonVPN, but didn't see anything to what I had in mind, though again, I could have discovered it and not known I was looking at it. ProtonVPN would allow me to choose custom ports, but not specific sites/addresses, and Mozilla offers to set a Manual Proxy, which appears close to what I am looking for, but seems more focused on proxying all but a select few sites; I want that in reverse.

**OS:** Windows 10  
**WSL:** Pengwin  
**VPN:** ProtonVPN  
**Browser:** Firefox Developers Edition

(I don't know if any of that is important here, but there it is)
  • On Unix/Linux, you could very likely hack a setup together for this. On Windows, I have no idea if it's even possible. – multithr3at3d Nov 21 '20 at 14:17

if you can use Linux in vmware or something you can use proxychains easily to satisfy your needs. We don't have many articles on how to use proxy chains on windows, but hey.. windows have ubuntu terminals now, you can use Linux subsystem for windows and then you can use proxychains.

This might not be the most optimal solution, but this can be done.


You need to identify the gateway address to your VPN, then add a route to route traffic for your destination to that gateway. It's not too complicated if you understand basic TCP/IP routing:

From https://www.howtogeek.com/howto/windows/adding-a-tcpip-route-to-the-windows-routing-table/

A routing table dictates where all packets go when they leave a system—whether that system is a physical router or a PC. Most routers—including the one built into your Windows PC—use some form of dynamic routing, where the router is capable of selecting the best place to forward packets based on information it gets from other routers. You can see it at work if you use the traceroute command to watch the connections a packet makes as it reaches it’s final destination.

The secret here in the default gateway. If you use the local default gateway, your Internet traffic will be routed to the local connection. If you use the VPN gateway, Internet traffic goes through the VPN connection. By default, Windows VPN connections use the remote VPN gateway for your specific destination.

You need to find the gateway IP address for your remote VPN connection and make it the gateway for the destination IP you want to route via VPN. To do that see https://superuser.com/questions/12022/how-can-i-make-the-windows-vpn-route-selective-traffic-by-destination-network

Check your OpenVPN config file to see the VPN gateway IP, or check the log output when you connect to the VPN. On Linux, I used the following guide to set up so all destinations go to the VPN. See https://sweetcode.io/routing-all-traffic-through-a-vpn-gateway-on-linux/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy