Tunneling internet traffic through VPN on a home router

7,791

Solution 1

You need a VPN endpoint. That could be a PC at home or a router. It doesn't appear that your router supports it directly. Using DD-WRT will allow for this. The whole process is rather complicated so the references are listed below.

The docs for install are here: http://www.dd-wrt.com/wiki/index.php/Netgear_WNDR3700 and the docs for using OpenVPN with it are here: http://www.dd-wrt.com/wiki/index.php/OpenVPN.

Solution 2

With regards to your side question, yes, it's easy to send only certain sites through the vpn, but it is done by IP address, not by domain name. So it won't work very well for sites with frequently changing IPs (rare) or a DNS round robin when not all IPs in the round robin are known (somewhat rare).

For a website to tunnel through the VPN, it's IP address (or subnet) needs to have an entry in the routing table on the client computer. That can be added manually on the client computer or it can be pushed to the client from the VPN server at connection time.

The manual way, for Windows, is as follows from the command prompt:

route add 123.123.123.123 MASK 255.255.255.255 gateway 10.0.0.1

where 123.123.123.123 is the IP address of the website, and 10.0.0.1 is the gateway IP on the VPN setup (possibly the LAN-side IP of your router, depending on how the VPN is configured).

To push the routes automatically, add the following line to the end of the OpenVPN config file on the server:

push "route 123.123.123.123 255.255.255.255";

again, where 123.123.123.123 is the IP address of the site. Note that in this case, OpenVPN will automatically handle putting the right gateway in.

Share:
7,791

Related videos on Youtube

alexeit
Author by

alexeit

Web Applications Development Specialist Platform / SRE / DevOps Cloud / AWS / Docker / Kubernetes High Availability / Scaling Microservices / Architecture / Routing CI/CD Go / PHP / Python My strength as a Platform Engineer is that prior to specialising in platform I spent over a decade working as Backend Engineer. This experience and skills allows me to build complex solutions and moving parts to convert monolitical apps to microservices or take more traditional apps to the cloud. I have a passion for improving the efficiency/experience of engineers by creating a better tooling and eliminating bottlenecks to let engineers focus on their task and not get distracted by anything else.

Updated on September 18, 2022

Comments

  • alexeit
    alexeit over 1 year

    I want to tunnel some of my internet traffic through home VPN for security. What do I need to do to achieve it?

    My laptop runs Windows7, the router I have is Netgear WNDR3700v2 with a stock firmware.

    I'm happy to change router firmware to some 3d party one if that would be required.

  • alexeit
    alexeit about 12 years
    A side question - it is possible to setup that only certain sites go throw the vpn and the rest go through directly, isnt it?