Posted: Sun Apr 30, 2017 0:05 Post subject: Routing all traffic to dedicated vpn gateway machine
After playing around with a couple of ways of connecting to a VPN, and being unhappy with the loss of bandwidth, I decided to set up a dedicated machine to work as a VPN gateway. It works great. Now I want to set things up so that everything on my home lan can use it, and things are not so great. I thought I could set up a static route that would send all traffic on the router through the gateway machine and out to the internet, but clearly I don't understand how to do this.
So, how does one set things up so that all traffic from lan gets routed through the VPN machine?
LAN -----> router -----> VPN gateway ----> intertoobs
I tried that while I was first waiting for a reply to my post, and again this afternoon. It doesn't work. As best I can tell, setting the gateway address in the basic network setup does nothing
Joined: 18 Mar 2014 Posts: 12910 Location: Netherlands
Posted: Thu May 04, 2017 9:47 Post subject:
OK, I fear there is something wrong in your network setup. You specify the router as gateway but it is on the same subnet, when both routers are on the same subnet you have to setup one router as a bridge or WAP.
You can route each client based on its IP address through the VPN or through normal route this is called Policy Based Routing. In the Open VPN client you fill in the IP address of the client which you want to route through the VPN e.g. 192.168.1.101/32 will route that IP address through the VPN. (Clients routed through VPN and through normal route can not see each other because of a bug, there is a script available to rectify that, if you want come back for instructions)
Seting up the VPN on the main router is easiest, but it is possible to set VPN on the WAP and route specific clients through this to route through VPN, but that involves some advanced trickery (I have that kind of a setup)