Advertisement

Set-Up an Always-On, Low-Power, VPN Using Raspberry PI

Securely access your network from anywhere in the world or encrypt your browsing in public Wi-Fi

By now we’ve all heard Internet bards praising the virtues of the Raspberry Pi in some form or another. And by bards I mean the hoard of makers/DIYers and digital media writers (such as me) populating your niche media. To recap: the Raspberry Pi is a mini-PC priced between $30 and $40s, with a 700-MHz CPU, 256 to 512Mbytes of RAM, an integrated GPU, an Ethernet port, and two USB ports; more than enough resources to create anything from a media center to a low cost server platform. The Pi’s low power consumption makes it the perfect candidate for an always-on VPN server to securely access your home network when traveling.

Raspberry_Pi_Logo
Raspberry PI’s HDMI and USB ports allow it to interface with monitor, mouse, and keyboard.

Preparing the Pi for Hamachi
For the purpose of this guide it will be assumed that your Raspberry Pi module is already set-up and running the Raspbian operating system. Make sure it’s updated to the latest version, as this will help immensely in eliminating compatibility issues later down the road. Type in the “sudo apt-get update” command to download the latest information on the newest versions of packages and their dependencies. Subsequently, use “apt-get upgrade” followed by “sudo apt-get install —fix-missing lsb lsb-core” to patch everything.

Installing Hamachi
Next, we will need to download and install Hamachi, the backbone of our networking operation. Hamachi is open-source software that virtually emulates a local area network, LAN, connection between computers. It provides 256-bit SSL encryption over both public and private networks; the same level of encryption used in banks. Hamachi doesn’t requiring any port forward, firewall bypassing, or obtaining an IP address; instead it automatically creates a VPN for you saving much trouble.

Type “sudo wget https://secure.logmein.com/labs/logmein-hamachi_2.1.0.101-1_armel.deb” to automatically download the latest Hamachi build onto the Raspberry Pi. Be sure the string of digits in the line of code match LogMeIn’s latest version of Hamachi for Linux. This can be verified on LogMeIn’s official website under the HamachiforLinux section. The “sudo dpkg -1 logmein-hamachi_2.1.0.86-1_armel.deb” string will install this build.

Configuration
Once the software is installed, create a LogMeIn Hamachi account, run the software, click the big blue icon to activate, and then select the network menu to set-up a network name and password. As Lifehacker informs us, this is accomplished using the following line of code:

sudo hamachi login
sudo hamachi attach [INSERT LOGMEIN.COM e-mailed]
sudo hamachi set-nick [INSERT A NICKNAME FOR YOUR RASPBERRY PI]

After this code is inputted, you’ll need to grant the Pi permission to actually access this network by logging onto your LogMeIn account from another machine. Be sure to save the network ID code for this network as you’ll need to input this code in the following step.

Having done that, type “sudo hamachi do-join [the 9 digit network ID you noted]” into the Pi’s command prompt to join this network – approval may need to be granted through LogMeIn on another machine. Nevertheless, it’s worth accessing LogMeIn to obtain the virtual IP assigned to your Raspberry Pi.

Congratulations, you’ll now be able to remotely access your Raspberry Pi using the SSH protocol with the. “sudo /etc/init.d/ssh start” command.

Install Hamachi clients on network computers
Download the LogMeIn Hamachi client on any machine to be included in the VPN. Choose a corresponding client compatible with your OS. Accessing the VPN from windows requires the use of an SSH client such as PuTTY or Terminal for Mac in order to enter the Raspberry Pi’s virtual IP.

Visit TechXchange and discuss any Raspberry Pi projects you’ve tried.

Advertisement



Learn more about Digi-Key

Leave a Reply