What I'm trying to achieve is:
Connect to a VPN as client and route all my internal network's traffic over the VPN.
Run a VPN server, so that people from outside can connect to my internal network and get routed over the a.m. VPN client.
I'm trying to achieve that with a router running dd-wrt (netgear D6200), and / or a raspberry pi.
Can someone tell me if this can be achieved, and if, direct me to what would be a possible solution?
(I'm not looking for a tutorial, just a direction)
Thanks!
This thread probably does not belong here.
Consider using
OpenWRT
instead ofdd-wrt
. OpenWRT gives you a usable build system and easier to customize and build. I am not advocatingOpenWRT
. This can be a stop gap measure.You can setup a OpenVPN server and OpenVPN client using the standard documentation available on OpenWRT Wiki and also OpenVPN site.
Add to OpenVPN
server.conf
the following directiveredirect-gateway def1
. This will push the default gateway to clients connecting to OpenVPN server. Further, make sure you are using a unique network IP pool for VPN clients and does not clash with the remove VPN server.Make sure you are masquerading the VPN traffic (Clients of local VPN server) before forwarding to remove VPN server. This can be tricky as this interface does not exist at boot time. It needs to be configured using
up
anddown
scriptsMake sure you are allowing traffic (clients of local VPN Server) on VPN interface to be forwarded in your firewall rules
Before setting up the OpenVPN server, make sure
You have setup the firewall correctly
You are able to reach the cloud through the Remote VPN Server. Checking with some site like
www.whatismyip.com
will help