OpenVPN on DD-WRT

Install Correct Firmware

Make sure you have the Router installed with the correct firmware. In the upper right corner it should mention "vpn".

You can get the Firmware of your Router from the official site of DD-WRT. Be sure to check whether your router model has supported Firmware of OpenVPN (In our case we have used OpenVPN generic firmware).

http://www.dd-wrt.com/

Once you have installed OpenVPN based firmware, open the web interface. Usually the default address to access the web interface is 192.168.1.1, but if you have a different IP configured, access through that IP.

The first page after installation will ask you to provide a new username and password for the web interface.

Set the credentials you wish for this step.

1.png439

Install Correct Firmware


Configuration of OpenVPN

Next, go to the Administration tab, and click on Commands as highlighted in the screen shot.

2.png224

Configuration of OpenVPN


Download Script and Edit username and password

Now, download the configuration script file. You can download the script file from this URL.

http://www.tuvpn.com/downloads/tuvpn.sh

Now, edit the downloaded script in notepad, and edit your username and password as per the highlighted area in the screen shot. This username and password will work in the same way as if you have enabled “save password option” in OpenVPN.

NB: Please be sure that you have typed in your username and password correctly.
For example, if your username is: "tuvpn_abcdxyz", and your password is: "tuvpn", then the text line should be read as follows;

echo –e “tuvpn_abcdxyz\ntuvpn”> /tmp/ovpn/pass

Copy all the contents by pressing keys, Control+A

config.png345

Download Script and Edit username and password


Copy and Pase Configuration file

Now go back to your router interface and paste the contents that you copied from the downloaded script in the COMMANDS box.

3.png216

Copy and Pase Configuration file


Save Changes

Once you paste the contents, click on “Save Custom Script

4.png314

Save Changes


Execute Script

Now type "sh /tmp/custom.sh" (without quotation marks) in the Commands box.

Then click on “Run Commands” at the bottom of the page.

5.png479

Execute Script


Execute Script

If successfully completed, you will see a message something like in the screen shot.

7.png451

Execute Script


Reboot Router to connect OpenVPN

Now go to Management under Administration tab again. Click on Reboot router.

This will put the script changes in the startup nvram of the router and on reboot this will connect you to the OpenVPN automatically.

Please allow a few minutes (3-5 minutes) for the router to connect with the TUVPN server after Reboot.

8.png163

Reboot Router to connect OpenVPN


Connected

Go to www.whatismyipaddress.com to confirm that you are connected with the VPN network.

10.png39

Connected


Optional Changes

Please note that there are certain limitations to this setup such as:

- You cannot disconnect OpenVPN directly from the web interface

- You cannot make use of change node until next Reboot

- There is no manual process to Restart OpenVPN from the web interface if for any reason you become disconnected.

These tasks can be performed by making use of the Terminal window of the Router. For this you either need to use Telnet or SSH (Putty). We personally like to use Putty for connecting Terminals(SSH) because of ease of use. For this you will need to enable SSH first.

However if you want, you can use telnet to connect and make the changes.

Enabling SSH:

Go to the Services under the Services tab.

11.png337

Optional Changes


Enable SSH access (OPTIONAL)

Select the radio button "enable" against "SSHd" service.  And Save the changes.

12.png308

Enable SSH access (OPTIONAL)


Putty Connection to Router (OPTIONAL)

Go to PuTTY and insert your router IP address using port 22.

In our case we have configured the router on 192.168.1.1 and SSH on port 22

15a.png429

Putty Connection to Router (OPTIONAL)


Connect Router (OPTIONAL)

Enter username and password.

Default logins are, User: root, and Password: admin

15b.png197

Connect Router (OPTIONAL)


To Disconnect OpenVPN (OPTIONAL)

To disconnect OpenVPN, type: killall openvpn

16.png282

To disconnect OpenVPN (OPTIONAL)


To start OpenVPN (OPTIONAL)

To start OpenVPN, type : openvpn --daemon --config /tmp/ovpn/tuvpn.conf

17.png157

To start OpenVPN (OPTIONAL)


Change VPN Node (OPTIONAL)

To change VPN node, type vi /tmp/ovpn/tuvpn.conf

Go to the line where it reads "remote vpn.tuvpn.com 1194", and change to the server of your choice.

Press the ESC key on your keyboard, then press the ‘i’ key to go into edit mode, then change the server node.

For example, to connect to the London VPN node, replace "remote vpn.tuvpn.com 1194" with "remote london.tuvpn.com 1194". 

Press ESC key again, type “ :wq " (without quotation marks) to save the changes and exit.

 

18.png430

Change VPN Node (OPTIONAL)


To Connect with New Server (OPTIONAL)

To connect with the new VPN server node, type;

killall openvpn

openvpn --daemon --config /tmp/ovpn/tuvpn.conf

Please allow a few minutes (3-5) for the Router to connect with the new VPN node.

16-17.png294

To Connect with New Server (OPTIONAL)


Connected to New Node (OPTIONAL)

Go to www.whatismyaddress.com to confirm that you are connected to a new VPN server node on the network.

20.png19

Connected to New Node (OPTIONAL)


< Back to Tutorials