| Quaintous | Published: |
(tags)
|
(category)
|
|
| Updated: | ||||
| Configuring OpenVPN on OpenWRT | ||||
The rationaleInstead of having every device connected to an access point establish a VPN connection, I wanted to have an access point which maintains an OpenVPN connection and tunnels all the traffic through. As an OpenWRT The following has been tested on the infamous (and discontinued) TP-Link WDR4900 V1 running OpenWRT 15.05 (chaos calmer) connecting to Private Internet Access VPN servers. ApproachThe big picture is to configure the router so it tunnels all the web traffic of its clients through VPN. For this we will define a virtual network device which is used by OpenVPN to tunnel the data and will force all the traffic going through the router to be channeled through this interface. Why OpenWRT?I used to have dd-wrt installed on my good old Linksys WRT54GL and it nearly always did everything I wanted. But then I got to know OpenWRT developers and professional users and decided to switch to it, mainly for the following reasons:
It was also important to have a familiar environment (i.e. *nix) for rapid development. Getting ReadyIn the following it is assumed that the router is connected via LAN and all commands are run in OpenWRT environment. You can establish an SSH connection as follows: The only package that is required is the and installed as follows: Configure: The InterfaceFirst an interface is defined which acts as the virual network device used by OpenVPM to tunnel the traffic. To do so the following lines are to be added to this creates the Configuring OpenVPNNow we want to have the traffic of router clients to be tunneled through the interface defined in previous section through VPN. This looks like a job for OpenVPN package installed earlier. One bad idea is to create an The better (and idiomatic) approach is to create an OpenVPN configuration under The OpenVPN authentication credentials are to be stored under You also need to have the certificate authority (CA) file and certificate revocation list (CRL) respectively available under Preventing DNS leaksUnfortunately OpenWRT does not update the DNS servers (see There are a number of ways in OpenWRT to use custom DNS servers. The one that worked for me without any complications was to disable Internet Kill SwitchThe PIA Android application has a nifty feature called the “Internet Kill Switch”:
We are going to have the same feature by configuring the firewall in a manner that forwards all the traffic on First thing is to define a zone in and the last step is to change the default The complete firewall configuration example is given here. To read more about OpenWrt firewall configuration see here. ConclusionHaving your traffic tunneled through VPN has, beside anonymity, a number of advantages. In Germany, for example, the Internet providers are not hold liable for any mishandling or copyright infringement of their users (see here for more info). So, for example, if you want to provide Internet access at your shop but doesn’t want to take responsibility for your customers surfing, you can just tunnel your traffic through VPN since the traffic is then technically going through another telecommunication service provider instead of your ISP. This has led some companies to register themselves as “telecommunication service providers” and let their customers have their traffic tunneled through their VPN servers against some amount of money. Using the method provided in this article you just need a router supporting OpenWRT and a VPN subscription (e.g. PIA as cheap as ~ 4$/month) to have the same effect with just a fraction of what you would pay those companies! |
||||
| License: | ![]() |
🟢 No JavaScript | (Notes) | |
| 🟢 No Tracking | ||||
