Happy news in the inbox–Visual Studio 2008 from Installfest has shipped! w00t!
When you have a phone number assigned to you by the phone company, it doesn’t change on a daily or monthly basis.Â It’s static.Â It only changes when you relocate to a different service area.Â That’s because your phone number is designed to be used for incoming communications–for people to call you.
On the other hand, your cable modem or DSL may not have a static number (called an IP address).Â That’s because these connections were meant for outbound communications–you surfing the Internet.Â Most providers will assign you a static IP if you request one, usually for an extra charge that may not make it worth doing.
If you can’t or don’t want to get a static IP, but still need a static way to find your node, you can look into a dynamic DNS service.Â Most of these are free for a single address.
DD-WRT supports a number DNS services, and you find the Dynamic DNS (DDNS) setup under Setup >> DDNS.Â Click the images for a larger view.
I’ve used DynDNS.org for a while now.Â It’s very simple and stable, and is free for a single address.Â You sign up with DynDNS, and choose the url subdomain (“hostname”) you’d like to use–it will be something like myvpn.gotdns.org.
After you’ve signed up for a DDNS account, go back to your router’s DDNS settings and enter your account’s settings.
Typically, you will have a Dynamic type of account, and it will not be a Wildcard account.Â These are more advanced configurations, and typically don’t come with the free services.Â You’ll know if you need them, and you can always upgrade the day you do.
After configuring the DDNS settings, the router in a short time will update your account’s settings.Â On the client end, you now need to edit your OVPN configuration file, and put the host name where the IP address was, in the “remote” line.Â Now, even though your IP address may be reassigned periodically, you’ll always be able to use a static host name to locate your VPN.
Setting up the VPN and the first client takes a while. Additional clients are easy.
First thing is to download and install OpenVPN GUI. Find the Installation Package under Stable downloads.
Next, you need to generate a new client key. You’ll either need to use the same computer as before, or make sure you have the CA cert/key pair handy to sign the certificates. The first option is better.
If you’re using the same computer, open a command window and get to c:\program files\openvpn\easy-rsa. Run the following commands:
- build-key client2 (remember to change the client # for eac additional client)
Copy ca.crt, client2.crt, client2.key and the OVPN config (from the config folder) to the new client. Edit the OVPN file and enter the correct client key and cert file names. It should look something like below (italics indicate the file names to change):
remote myvpn.gotdns.org 1194
You should be set–start the client and hit connect.
[note: this post was written in Feb, 2008, and used the current-at-the-time version of dd-wrt. Â My router has been working for almost 4 years, so I haven’t repeated the process from the beginning with the latest version. The information below may or may not be 100% accurate with the current version.]
I needed an inexpensive but flexible VPN solution.Â Inspired by some blog posts and podcasts (linked below), I looked into changing the firmware on my Linksys router.Â The firmware I found is the open source DD-WRT.Â I am by no means a Linksys or DD-WRT expert.Â I’m just someone who managed to muddle through things on my own.Â Some steps I got right the first time, and some took a couple of tries.Â This post, and my explanations and experiences, are one contribution back to the community.Â I hope they help!
According to the DD-WRT list of supported hardware, my current router (a WRT54GS v5) won’t work.Â So I picked up a Linksys WRT54GL from Amazon, and went to work.Â Again, make sure you get the GL version.
I installed DD-WRT v23 SP2 VPN, generic version, using Internet Explorer (apparently there is sometimes a timeout issue with FireFox when uploading the firmware).Â At the time of this post, this is the most recent stable version.Â There are several editions of DD-WRT, so make sure you get the VPN version.Â The generic edition is the one to use for the WRT54GL router.Â You can check their download section to look for a different edition, or see if there is a more recent version.
On a fresh, out of the box router, installation was a snap.Â I simply logged in to the web interface, uploaded the new firmware and rebooted the router.Â I did not need to use the mini version first, since I have a WRT54GL v1.1 (you can check your version on the bottom of the router).Â The older models apparently have a 2MB limit on the upload file size, and the DD-WRT file is 3+MB.Â There is no such limitation on v1.1 and above WRT54GL routers, so if you have one of these, you can upload the full version right away.
After making sure I could access the Internet through the router, the fun began–setting up the VPN.
To enable the VPN on the router, log in to the web interface and go Administration >> Services.
Scroll down to the OpenVPN section and select Enable.Â On my installation, I accepted the default port, protocol and TUN settings.Â Scroll to the bottom of the page, and save the settings.Â A reboot of the router wouldn’t be a bad idea.
DD-WRT implements OpenVPN, which is great but also means setup instructions are spread over several websites.Â There are a couple configurations you can use–Server Mode with Static Key (which is simpler to set up, but only allows a single VPN connection), and Server Mode With Certificates, which is a little more complicated but allows multiple simultaneous connections.Â I chose Server Mode with Certificates, since I need multiple connections.Â The formatting on the wiki page makes following the tutorial a little confusing, so I’ll try to guide you through the steps.Â There is some bouncing around to several sites during the configuration, which can get a little confusing, too.
Before you do anything else on the router, go to http://openvpn.net/ and download the OpenVPN client.Â You need to install the client in order to generate the certificates needed during the router configuration.Â Since I’m a Windows user, I downloaded the OpenVPN GUI for Windows (this is a separate site from the OpenVPN site, and the download is all you need from this site).Â Look for the Installation Package under the Stable downloads.Â Run the installer and let it do its thing.Â You may be prompted that an adapter has not passed Windows testing–in this instance, that’s OK, go ahead and install it.
Once the client is installed, you need to generate at least three sets of keys and certificates and one set of encryption parameters to ensure your VPN’s security.Â All the utilities you need are installed with the OpenVPN GUI client.Â Before we generate any keys, I’ll explain what they do.Â Also, configuring the VPN causes the router to reboot at one point, so it’s a good idea to do this when no one is connected.
The full instructions for generating the certificates and keys you need are on the OpenVPN site at http://openvpn.net/howto.html#pki.Â Once you complete the section for generating the certs and keys, you’re done with their site.
Important!Â When you generate your certs and keys, you’ll be prompted to enter some variables.Â In some cases, this information needs to be the same for all certs and keys, and some variables need to be different.Â Pay attention to the variables for each set of certs and keys!
I recommend editing the vars.bat file to make life a little easier.
Now is the time to start generating your certs and keys.Â Follow the instructions (linked above), but read through the commentary below for each cert before actually creating it.
You’ll be acting as your own Certificate Authority, so you need to generate a CA certificate and a CA key, which are used to sign each of the subsequent certificates and keys.Â Having the same CA signature on the client and the server means both keys were generated by the same person, and is the top level of trust between the server and the client.Â You need to keep the CA cert and key a secret, and you need to be sure to securely archive a copy of each so you can create additional certs and keys in the future.Â You’ll install the CA cert (but not the key) on the router, and use it to sign any future client keys.Â If you edited the vars.bat file, when you generate the cert and key, you only need to enter the Common Name variable.Â You can make this whatever you like, but I suggest using something recognizable such as your business name or your name.
The next certificate and key are for the server.Â These both will also be installed on the router.Â For this pair, when you are prompted to enter the Common Name, enter something like “server”.Â Also, be sure to sign and commit the certificate.
For each client you want to connect to the VPN, you’ll need to generate a certificate and key.Â These will not be loaded onto the server–instead, you’ll copy one set to each client.Â Client sets are the only ones you’ll generate multiple ones of.Â For each client cert/key pair, enter a different Common Name for each (such as “client1”, “client2”, etc).
Since certificates need to be exchanged over the open Internet, we’ll need a little additional cryptography to ensure they are secure.Â OpenVPN uses Diffie-Hellman as part of the key exchange.Â These will be loaded onto the server.Â There are no additional variables to enter for these.
Once the certs and keys have been generated, pick up in the Server Configuration steps of Server Mode with Certificates section of the DD-WRT site.Â The next few paragraphs flow along with the instructions there.Â Read their instructions, then read my comments below before doing anything.
Step 2 & 4: Copy the sample rc_startup script into a text editor, and insert the ca.crt, server.key, server.crt and dh1024.pem where indicated (you’ll find the keys and certs at c:\program files\openvpn\easy-rsa\keys).Â I also had to change the last line of the script to the workaround shown.Â After I had set everything up, I couldn’t keep the VPN connection open, and this workaround fixed the problem.Â If you changed the port or protocol when you enabled the VPN service, you need to make sure the changes are reflected in this script, too.
Once you’ve inserted the proper keys and certs, log in to the web interface and navigate to the Commands tab.Â On a new installation, you should not have any saved commands, so all you need to do is copy the rc_startup script into the box and click the Save Startup button.
Step 3-5:Â On a fresh installation, you won’t have a saved rc_firewall command.Â Copy the one shown, and save the firewall script the same way.Â Reboot the router, if it doesn’t happen for you.
Step 6: You can use the DOS telnet command to access the router and execute the shell command.Â Simply go to a command window, and type “telnet 192.168.1.1”.Â Log in, and execute the “ps | grep openvpn”.Â This command searches the stack of recently executed instructions and prints them to the screen.Â You should see a couple of commands show up, indicating OpenVPN has been called, and is therefore running.
Once the server is configured, follow through the Client Configuration section (at this time, only three steps and a short explanation).Â Copy a client key and cert pair to the config folder (C:\Program Files\OpenVPN\config), as well at the ca.crt, and save the config file to this same folder.Â Name the file whatever you want, but the extension should be .ovpn.Â Make sure you put in the proper IP address to your router, and enter the right file names for the CA cert and client cert/key.Â Â You should now be able to connect to your VPN–just remember to try it from outside your LAN!Â Start the OpenVPN Gui client from the Start menu, and it will appear in the taskbar, down by the clock.Â Right-click on the icon and choose Connect.
If you don’t have a static IP address, you might want to look into a dynamic DNS service, such as DynDNS.org (see link below).Â You can set up a free account, and choose a custom subdomain.Â You can configure the DD-WRT software to update the DynDNS records every time your IP changes.Â This way, you only need to configure a DNS name in the config file, and you can always access your system.
OpenVPN GUI has a console where you can see what’s going on.Â I ran into a couple problems with my VPN.
If the connection is made and drops repeatedly, make sure you use the workaround in the rc_setup script (replacing the last line with the two indicated below the script).
If you can connect to the VPN, and an ipconfig /all shows you have an IP address from the VPN server, but you can’t access anything inside your network, it might be your local router.Â My old home router prevented me from accessing any of the remote resources.
For a recent client’s project, I needed a good looking DotNetNuke skin. After searching through Snowcovered, I cam across the DotNetNuke skins by DNN Covered. These skins are amazingly beautiful! We purchased one, uploaded it, and it worked perfectly. It’s perfect for our site.
Not only are their skins beautiful and affordable, they have great customer support. The skin page said the PSD files were included in the package, but they were not present in the download. I put in a help ticket before going to sleep, and when I woke up the next morning, I had a reply with the PSD files from DNN Covered.
DNN Covered definitely has the feel for how DotNetNuke works, and a feel for the DNN community. Thanks DNN Covered!