Routing all traffic to dedicated vpn gateway machine

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
IanBurry
DD-WRT Novice


Joined: 29 Apr 2017
Posts: 2

PostPosted: Sun Apr 30, 2017 0:05    Post subject: Routing all traffic to dedicated vpn gateway machine Reply with quote
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


FWIW:
Firmware: DD-WRT v3.0-r28493M std (12/10/15)
router in gateway mode: 192.168.1.0/24
vpn gateway static IP: 192.168.1.201
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12910
Location: Netherlands

PostPosted: Tue May 02, 2017 11:13    Post subject: Reply with quote
In your main router under Basic Setup/ Network Setup specify 192.168.1.201 as gateway, all your DHCP clients will route through the VPN
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
IanBurry
DD-WRT Novice


Joined: 29 Apr 2017
Posts: 2

PostPosted: Wed May 03, 2017 22:59    Post subject: Reply with quote
Thanks for the response.

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
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12910
Location: Netherlands

PostPosted: Thu May 04, 2017 9:47    Post subject: Reply with quote
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.

Both routers in gateway mode (Lan-WAN connection) is possible, but if your VPN is on your router which is connected to the internet then set the second router as WAP see: https://www.dd-wrt.com/wiki/index.php/Wireless_Access_Point

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 Smile (I have that kind of a setup)

If you want both routers in gateway mode (LAN-WAN connection and different subnets) see attached document for instructions. In that case the same applies, setting up a VPN on the main router is easiest but it can be done on your secondary router.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum