Hack 70: Create a Virtual Private Network (VPN) with Hamachi – Get Your Data to Go online
You can perform actions between computers on your local network that you can’t from out on the Internet, such as listen to a shared iTunes library or access files in shared folders. But using the free, virtual private network (VPN) application Hamachi (https://secure.logmein.com/products/hamachi2), you can securely access your computer from anywhere on the Internet as if you were home on your local network.
This hack uses LogMeIn Hamachi to create a VPN between a PC and a Mac and to listen to a shared iTunes library over the Internet.
What is Hamachi VPN?
The free Hamachi desktop application gives you a secure, zero-configuration LAN over the Internet. Any application that works over a local network can be used with Hamachi over the Internet, such as Windows file sharing, iTunes, Remote Desktop, FTP, VNC, and gaming. All Hamachi’s connections are secure, encrypted, authenticated, and peer-to-peer. Although Hamachi acts as a mediator between your computers and creates the tunnel for its communication, Hamachi’s servers don’t listen in on or log your activity.
You might use Hamachi in the following situations:
· You’re on the road with your laptop and want secure access to your PC’s files.
· Your office or dorm-room computer is behind a restrictive firewall that doesn’t allow you to reach it from the Internet.
· You want to add encryption to insecure network protocols such as VNC.
· You want to set up a shared folder of files for friends and family to access.
Sound useful? Read on to start.
Set Up Hamachi
The following sections lead you through downloading and installing Hamachi’s VPN and setting up your Hamachi network.
Download and Install Hamachi
Download the right version of Hamachi for your operating system from https://secure.logmein.com/products/hamachi2/download.aspx. For the most part, the Windows installation is a regular wizard — just click Next to step through it.
NOTE Hamachi is free for personal, noncommercial use on up to 16 computers. Although available for Windows, Mac, and Linux, this hack focuses on the Windows setup specifically. The Mac application is nearly identical, but the Linux version is currently available as a command-line only tool.
During installation, Hamachi attempts to install a virtual network adapter. If you have Windows Firewall enabled (or any firewall, for that matter), the firewall program may ask whether you want to allow traffic to and from the Hamachi client. You do. Click the Unblock button to allow Hamachi traffic through your firewall.
Create Your Hamachi Network
When Hamachi is installed, launch the application and click the blue power button. It prompts you to create a new network or join an existing network. Click Create New Network, and give your network a name (for instance, lifehacker-home) and a password (if you’d like), as shown in Figure 8-10. Click the Create button.
Figure 8-10: Set your new VPN’s name and the password. Any computers that join your network must enter these.
Now your computer will be a member of the new network and get its own Hamachi IP address (in addition to its regular IP address). It will also have a nickname that can identify it on your network.
Invite Others to Join Your Hamachi Network
Right away, you can tell your friends or co-workers your Hamachi network’s name and password so that they, too, can join it with the Hamachi client installed on their computers. Alternatively, you can join your own network from another computer (such as your PC at the office). For example, I’ve connected my Mac (nicknamed Air) to the lifehacker-home network, and the Hamachi client on my PC displays my Mac online, as shown in Figure 8-11.
Figure 8-11: The Hamachi client displays which computers in your network are online.
You can also administer your Hamachi network from its web interface when you’re not running the Hamachi client itself, but you need to have created the network from the web interface. Log into the LogMeIn website at https://secure.logmein.com and click the Network link in the left sidebar to view a list of networks you own (see Figure 8-12). From the web interface, you can create or delete networks, add clients, accept requests to join your network, and even evict computers to which you want to deny access. Click a network name to see all the computers on that network.
Figure 8-12: View the list of computers connected to your Hamachi network from the control panel at secure.logmein.com.
Now you’re ready to put your private network to good use.
What You Can Do Over Hamachi VPN
Anything you can do over a local network — your home wireless network, for example — you can do over the Internet between two computers on a Hamachi VPN. Share files, printers, or stream your iTunes library from your home Mac to your office PC. Browse shared Windows folders, access your home media server over FTP, remotely control your computer over VNC, or access a private home web server over Hamachi VPN, which adds an extra layer of security and privacy. See Hacks 71, “Run a Home Web Server” and 74, “Remotely Control Your Home Computer” in this chapter, and couple those techniques with Hamachi to encrypt and restrict access to your home computer.