...

Tuesday, July 27, 2010

Misc 46

Now this would actually be a pretty quick one. We'll build on the knowledge gained in this article to set up the WRT54G router, then we'll install a client on Windows separately.
Now before we go any further, I'll need you to flash your router to the TomatoVPN firmware. This will add OpenVPN capabilities into your router allowing it to act as a VPN terminator. TomatoVPN can be obtained here.

Note that you should be responsible for your own router and I will not be held liable for any damage resulting from anything. Now I had to say that to give myself some immunity.

Once you've got connectivity back up, it's time to hop on to your router. Browse on over to VPN Tunneling - Server:


This is the page where we set the basic parameters. If you feel that these settings are familiar, in fact they are! Those are the same settings found in the server.conf file. I changed my subnet address to 192.168.2.0/24 but it may not work for you depending on the addressing scheme used at your remote location. Now notice that if you attempt to click on Start Now, it will not work. This is because we still need to set the CA certificate, Server keypair, and the DH parameters. Now this is all coming together isn't it?

Now browse on over to the second page:


Notice that I included to push the route to the client. This is so that the clients can access each other. Finally we find ourselves at the Keys page. Is this going to be a nightmare? At first, it may seem so. But when you look again, you'll realize that you already have all the components. Hop on over to your Linux router and open the ca.crt with Notepad. We now PASTE the exact contents over. Do the same for your server keypair and the DH parameters:


Now that you have everything in place, simply save, then click on Start Now and you are done with the server part! Now it's time to set up the Windows side of things. For this, I'm going to grab a copy of openvpn-2.1.1-install.exe from the official OpenVPN website.

When it prompts to install a TAP/TUN driver, let it do so. This is the interface that will support the tunnel later on. Once installation is done, it's time to set up everything. First, copy the ca.crt and your client keypair to:
C:\Program Files\OpenVPN\config\


If you're on a x64 system, you may have to go to:
C:\Program Files (x86)\OpenVPN\config\


Now, go back one folder and move into the sample-config folder. Make a copy of client.ovpn and paste it into the config folder. Double-click on it, and guess what? It's exactly the same as client.conf in Linux! Now, simply edit it the same way as you would in this article and save the file.

To start the VPN client, simply open OpenVPN GUI and look at your System Tray for the logo. Right-click on it and click on Connect! Test your ping connectivity and it should be fine and dandy!

Now, if you wish to automatically connect to the router every time you boot up, simply go to Start - Run - Services.msc and set OpenVPN service to start up automatically!

No comments :

Post a Comment

<