I have been using Hamachi since first hearing about it on Security Now, over 10 years ago. Hamachi is a hosted virtual private network solution that can create links with devices that are behind NAT firewalls. Hamachi is able to do so by using server-assisted NAT traversal. I mostly use it to access virtual machines from outside of my house.
LogMeIn officially supports OS X and Windows but they have had Linux installers available in beta for the past ~9 years. Previously, I have been able to run hamachi on my Raspberry Pi 1 Model B using widely available instructions. Unfortunately, it looks like it does not work as well on the Raspberry Pi 3.
According to the LogMeIn forum: “Raspian is a hybrid version, so not fully armhf, and requires software specifically designed for it. You’ll find the quite a few standard armhf packages won’t work on Raspian, unless made specifically for it.”
If you try to install from the armel debian software package it will complain and if you install from the armhf file, it will error-out. So, how do you install it, then?
- sudo apt-get install lsb-core
- sudo wget https://secure.logmein.com/labs/logmein-hamachi-220.127.116.11-armel.tgz
- sudo tar xvf logmein-hamachi-18.104.22.168-armel.tgz
- cd logmein-hamachi-22.214.171.124-armel
- sudo ./install.sh
Unfortunately, this does not work for me any better than the ARMHF debian software package.
So, are we out of options? Fortunately, there is another way. LogMeIn offers a way of connecting mobile clients via a more traditional VPN connection.
If you try to install the Raspberry Pi as a mobile device, you are given a server address, a user ID, and a password for connecting a mobile device using IPSec or PPTP. Of the two, you are better off using IPSec because it is much more secure. I am going to opt to show you how to use the Point-To-Point Tunneling Protocol though, because it is easier to configure.
The first this that you need to do is to install the PPTP client.
sudo apt-get install pptp-linux
Next, you need to create a peer file (/etc/ppp/peers) for the the connection. Create a new file within the peers folder and name it “hamachi”. It should contain the following:
pty "pptp m.hamachi.cc --nolaunchpppd --debug" name $USERNAME password $PASSWORD remotename PPTP require-mppe-128 require-mschap-v2 refuse-eap refuse-pap refuse-chap refuse-mschap noauth debug persist maxfail 0 defaultroute replacedefaultroute usepeerdns
You can get the values for $USERNAME and $PASSWORD from the properties of the Hamachi connection.
Once you save the file, you connect your Raspberry Pi to the Hamachi network by running the command:
sudo pon hamachi
You are not going to want to manually connect to the hamachi each time you restart the pi, so you will want to set it up to connect on boot. Navigate to the /etc/init.d folder on your pi and create a new file named “hamachi.sh”.
#! /bin/sh pon hamachi echo "PPTP Started"
With the script in place, you can run …
sudo update-rc.d hamachi.sh defaults
… to make the script run at startup.
Please keep in mind that PPTP is easy to set up and is less taxing on the CPU but it is also insecure. It is worth looking into either going the IPSec route or layering on additional security.
Have a question, concern, and / or comment? Feel free to leave it within the comments below.