Getting Hamachi working with the Raspberry Pi 3

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?

  1. sudo apt-get install lsb-core
  2. sudo wget https://secure.logmein.com/labs/logmein-hamachi-2.1.0.139-armel.tgz
  3. sudo tar xvf logmein-hamachi-2.1.0.139-armel.tgz
  4. cd logmein-hamachi-2.1.0.139-armel
  5. sudo ./install.sh

Unfortunately, this does not work for me any better than the ARMHF debian software package.

Raspbian Hamachi ./install.sh output

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.

LMI Hamachi Mobile Client

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.

Screen Shot 2016-03-19 at 2.41.00 PM

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.

2 thoughts on “Getting Hamachi working with the Raspberry Pi 3

  1. This works great, but I lose internet access when hamachi boots up. If I change the gateway back to my router on the internet uding the command “sudo rout add default gw 192.168.1.1 dev eth0” it works but then I can’t ssh into the hamachi ip address.

    Any ideas how I can change the routing tables on the pi to have internet traffic not routed to the hamachi gateway but to the internet/router gateway buyt have the ssh sessions connect via the hamachi gateway.

Leave a Reply

Your email address will not be published. Required fields are marked *