This is an advanced tutorial on how to connect a router with OpenWRT firmware version 21.02 to PureVPN.
- First, you need a router with OpenWRT firmware (tested with version 21.02) and an enabled OpenVPN client. The router will accept SSH connection open it with PuTTY . The OpenVPN package isn’t included in the firmware image by default, so you need to install it:
Install PuTTY and access router IP in my case 192.168.0.1
- Enter the Root and password of router.
- Run the following commands to install OpenVPN
- opkg update
- opkg install luci-app-openvpn
- opkg install openvpn-openssl opkg install ip-full
- Next, you will need to download the configuration files. I suggest using configuration files, which can be found here.
- After downloading the file “OVPN Version 2.0.zip”, unzip files to a known location and go to either TCP or UDP folder which contains ovpn files per We will use as an example Spanish server with the file “es2-ovpn.ovpn”.
We will need to copy some files from the computer to the router, for that we need to activate SFTP on the router. To do this run SSH commands.
- opkg update
- opkg install openssh-sftp-server
- Now copy the desired file ” es2-ovpn.ovpn ” using the WinSCP on Windows to the /etc/openvpn/ folder of the router’s
- Right click on Right side (router side) and select a new File with name “secret” (without file extension), put the VPN credentials. Here is how you can find your VPN credentials. (This data is available under the ‘Account & Billing’ tab in the PureVPN Member area).
- Save and close the File in the end.
- Edit “es2-ovpn.ovpn” and put path to “secret” file, which contain PureVPN credentials (as shown in the picture below).
- Save and close the File in the end.
- Configuring OpenVPN (Continuing using SSH with PuTTY) Specify the file name in /etc/config/openvpn.
- uci set openvpn.purevpn=openvpn
- uci set openvpn.purevpn.enabled=’1′
- uci set openvpn.purevpn.config=’/etc/openvpn/es2-ovpn.ovpn’
- uci commit openvpn
#(es2-ovpn.ovpn is the openvpn file we used in this setup, you will have to use/enter your desired file’s complete name here)
- Now you need to configure the DNS The simplest approach is to use Google DNS for the WAN interface of the router and to set the router DNS:
- uci set network.wan.peerdns=’0′
- uci del network.wan.dns
- uci add_list network.wan.dns=’8.8.8.8′
- uci add_list network.wan.dns=’8.8.4.4′
- uci commit
- reboot
- Please wait for atleast 1-2 mins after the router is rebooted and then relogin and go to OpenVPN tab under VPN to check the connection status.
- Your PureVPN profile is activated and you are connected to VPN.