Difference between revisions of "Hamachi"

From ArchWiki
Jump to: navigation, search
m (Bot: Removing from Category:HOWTOs (English))
(init.scripts (depreciated): Remove old rc.d method.)
(47 intermediate revisions by 18 users not shown)
Line 1: Line 1:
[[Category:Networking (English)]]
+
[[it:Hamachi]]
  
=Introduction=
+
[[Category:Virtual Private Network]]
 +
{{Poor writing|Needs to be updated for [[Help:Style]] compliance.}}
 +
[[Wikipedia:Hamachi (software)|Hamachi]] is a proprietary (closed source) commercial VPN software. With Hamachi you can organize two or more computers with an Internet connection into their own virtual network for direct secure communication.
  
With Hamachi you can organize two or more computers with an Internet connection into their own virtual network for direct secure communication.
+
== Installation ==
 +
Version 2 of the Linux Hamachi client exists and is currently in beta.  It is available from [https://secure.logmein.com/US/labs/ the labs page on the Hamachi website]; however, the vendor's tarball requires LSB and will not install correctly. You should use the {{AUR|logmein-hamachi}} package from the [[AUR]] instead.
  
Hamachi is fast, secure and simple. It is also free.
+
==Configuration==
  
=External Links=
+
=== Set Up Tun ===
  
'''Hamachi public networks for popular Games : [http://www.hamachi.cz www.hamachi.cz]'''
+
Being as section above can only be applied for init.scripts, in order to install the module, as root run:
<br />
+
# modprobe tun
English translate : '''[http://www.eng.hamachi.cz www.eng.hamachi.cz]'''
+
<br />
+
Individual help : '''[http://www.forum.hamachi.cz www.Forum.hamachi.cz]'''
+
  
=Initial Configuration=
+
Then add tun to the list of modules by using your favorite text editor and Create
 +
{{hc|/etc/modules-load.d/tun.conf |
 +
#Load tun module at boot.
 +
tun
 +
}}
  
To run Hamachi you need /dev/net/tun.
+
=== Hamachi 2 (beta) ===
  
This is created by the tun module. As root run,
+
Hamachi 2 is configured in {{ic|/var/lib/logmein-hamachi/h2-engine-override.cfg}} (create that file if it doesn't exist).
<pre>
+
Unfortunately, it isn't easy to find a comprehensive list of possible configuration options, so here are a few that you can use.
modprobe tun
+
</pre>
+
  
Or you can manually create /dev/net/tun by running...
+
====Using the hamachi command line tool as a regular user====
<pre>
+
In order to use the {{ic|hamachi}} command line tool as a regular user, add the following line to the configuration file:
mkdir /dev/net
+
{{bc|Ipc.User YourUserNameHere}}
mknod /dev/net/tun c 10 200
+
</pre>
+
  
Also, make sure to add the "tun" modules to rc.conf so that /dev/net/tun is created next time your computer turns on.
+
====Automatically setting a custom nickname====
 +
Normally, Hamachi uses your system's hostname as the nickname that other Hamachi users will see. If you want to automatically set a custom nickname every time Hamachi starts, add the following line to the configuration file:
 +
{{bc|Setup.AutoNick YourNicknameHere}}
  
<pre>
+
You can also manually set a nickname using the {{ic|hamachi}} command line tool:
MODULES=(... ... ... ... ... tun ... ... ...)
+
{{bc|# hamachi set-nick YourNicknameHere}}
</pre>
+
  
=Download And Install Hamachi=
+
However, this needs to be done every time Hamachi is (re-)started, so if you always want to use the same nickname, setting it automatically (as explained above) is probably easier.
==From the AUR==
+
Hamachi is available in the AUR, [http://aur.archlinux.org/packages.php?do_Details=1&ID=3709&O=0&L=0&C=0&K=hamachi&SB=&SO=&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd here].
+
  
Download the package, untar it, and run...
+
==Running Hamachi==
  
<pre>
+
Start up the (matt) daemon
makepkg
+
{{bc|
</pre>
+
$hamachi start
 +
}}
  
in the hamachi directory that is created.
+
or, if you use systemd
 +
 +
{{bc|
 +
#systemctl start logmein-hamachi}}
  
 +
Now you have a whole bunch of commands at your disposal. These are in no particular order and are fairly self explanatory.
  
Then add the package with...
+
{{bc|
 
+
<pre>
+
pacman -A hamachi-(package version)
+
</pre>
+
 
+
 
+
Now as root run...
+
<pre>
+
tuncfg
+
</pre>
+
 
+
 
+
Finally, run hamachi-init
+
<pre>
+
hamachi-init
+
</pre>
+
 
+
==Manual installation==
+
Or you can get it manually.
+
 
+
Head to [http://files.hamachi.cc/linux/ hamachi.cc] and download their linux client.
+
 
+
Untar it
+
<pre>
+
tar zxvf hamachi-x.x.x-x.tar.gz
+
</pre>
+
 
+
Compile:
+
<pre>
+
cd hamachi-x.x.x-x
+
make install
+
</pre>
+
 
+
And run tunecfg
+
<pre>
+
cd tuncfg
+
./tuncfg
+
</pre>
+
 
+
Run hamachi-init
+
<pre>
+
$hamachi-init
+
</pre>
+
And thats the installation.
+
 
+
==Version 2 beta==
+
 
+
Version 2 of the Linux Hamachi client exists, and is currently in beta.  It is available from the AUR under the name <pre>logmein-hamachi</pre> Or from [https://secure.logmein.com/US/labs/ the labs page on the hamachi website].
+
 
+
=Running Hamachi=
+
Start up the (matt) daemon
+
<pre>
+
$hamachi start
+
</pre>
+
Now you have a whole bunch of commands at your disposal. These are in no particular order, and are fairly self explanitory.
+
 
+
<pre>
+
 
$hamachi set-nick bob
 
$hamachi set-nick bob
 
$hamachi login
 
$hamachi login
Line 113: Line 60:
 
$hamachi list
 
$hamachi list
 
$hamachi go-offline my-net
 
$hamachi go-offline my-net
</pre>
+
}}
  
To get a list of all the commands just run:
+
To get a list of all the commands, run:
<pre>
+
{{bc|
 
$hamachi ?
 
$hamachi ?
</pre>
+
}}
  
'''Note:''' Make sure you change the status of the channel(s) you are in to online if you want to perform any network actions on computers in there.
+
'''Note:''' Make sure you change the status of the channel(s) you are in to "online" if you want to perform any network actions on computers in there.
  
==As a Daemon==
+
===Systemd===
  
You can run hamachi as a daemon this way:
+
The {{AUR|logmein-hamachi}} AUR package also includes a nice little [[Systemd]] daemon.
  
Copy your configuration to ''/root'' directory:
+
If you feel like it, you can set Hamachi to start at every boot with Systemd:
  
<pre>
+
{{Bc|
cp -R ~/.hamachi /root/
+
systemctl enable logmein-hamachi
</pre>
+
}}
  
Create a script in ''/etc/rc.d/'' called ''hamachi'' using your preferred editor:
+
To start the Hamachi Daemon immediately, use this command:
  
<pre>
+
{{Bc|
. /etc/rc.conf
+
systemctl start logmein-hamachi
. /etc/rc.d/functions
+
}}
  
DAEMON=/usr/bin/hamachi
+
{{Note|If for some reason, hamachi doesn't have a Systemd daemon, you can use [[Services#Logmein_Hamachi|one from here]].}}
NAME=hamachi
+
DESC="Hamachi VPN client"
+
PID_FILE=/var/run/daemons/hamachi
+
  
case "$1" in
+
==GUI==
    start)
+
Various GUI frontends for Hamachi are available in the AUR.
        #Check for running tuntap, start when not running
+
        ck_daemon tuntap && /etc/rc.d/tuntap start
+
        stat_busy "Starting $DESC"
+
        $DAEMON -c /root/.hamachi $1 > /dev/null
+
        if [ $? -gt 0 ]; then
+
            stat_fail
+
        else
+
            add_daemon $NAME
+
            stat_done
+
        fi
+
        ;;
+
    stop)
+
        stat_busy "Stopping $DESC"
+
        [ -f $PID_FILE ] && $DAEMON -c /root/.hamachi $1 > /dev/null
+
        if [ $? -gt 0 ]; then
+
            stat_fail
+
        else
+
            rm_daemon $NAME
+
            stat_done
+
        fi
+
        ;;
+
    restart)
+
        $0 stop
+
        $0 start
+
        ;;
+
    *)
+
        echo "usage: $0 {start|stop|restart}"
+
;;
+
esac
+
exit 0
+
</pre>
+
  
Remeber to add ''hamachi'' to your ''daemons'' array in ''/etc/rc.conf'', it should be put after ''tuntap''.
+
For Hamachi 1:
 
+
And don't forget to:
+
 
+
<pre>
+
chmod +x /etc/rc.d/hamachi
+
</pre>
+
 
+
=GUI=
+
Various GUI frontends to hamachi are available in the AUR.
+
 
+
For hamachi 1:
+
  
 
*haguichi (Gtk2, mono)
 
*haguichi (Gtk2, mono)
 
*ghamachi (Gtk2)
 
*ghamachi (Gtk2)
*hamachi-hui (Gtk2)
+
*hamachi-gui (Gtk2)
  
For hamachi 2 beta:
+
For Hamachi 2 (beta):
  
 
*quamachi (Qt4)
 
*quamachi (Qt4)
 +
*haguichi (Gtk2, mono)
  
=Troubleshooting=
+
==Troubleshooting==
==If Hamachi times out soon after launch==
+
===Hamachi times out soon after launch===
 
If hamachi stops working after a short period of time it can be that the client is timing out. Create ~/.hamachi/config and add the following to it:
 
If hamachi stops working after a short period of time it can be that the client is timing out. Create ~/.hamachi/config and add the following to it:
 
   
 
   
<pre>
+
{{bc|
 
KeepAlive 10
 
KeepAlive 10
</pre>
+
}}
 +
 
 +
===If you have problems connecting to some hosts===
 +
Check if they are using Hamachi 2. If that is the case, then it is a known issue with the Hamachi 2 client connecting to the Hamachi Linux client.
 +
 
 +
===''/etc/init.d/logmein-hamachi'' is not found===
 +
Replace that path with ''/etc/rc.d/logmein-hamachi''.
 +
 
 +
===Error when trying to run hamachi-init===
 +
If there is an error while trying to load libstdc++.so.5, you want to install it. This library can be found in the ''extra'' repository, so you can install it by running {{ic|pacman -S libstdc++5}}.
 +
 
 +
If you get an error while trying to load libcrypto.so.0.9.7, a temporary solution is to create a link from /usr/lib/libcrypto.so.0.9.7 to /usr/lib/libcrypto.so by running {{ic|ln -s /usr/lib/libcrypto.so /usr/lib/libcrypto.so.0.9.7}}.
  
==If you have problem connecting to some hosts==
+
==See also==
Check if they are using Hamachi2, if that is the case then it's a known issue in Hamachi2 client connecting to the Hamachi linux client.
+
* [https://secure.logmein.com/products/hamachi/ Project home page]

Revision as of 06:03, 12 April 2013

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: Needs to be updated for Help:Style compliance. (Discuss in Talk:Hamachi#)
Hamachi is a proprietary (closed source) commercial VPN software. With Hamachi you can organize two or more computers with an Internet connection into their own virtual network for direct secure communication.

Installation

Version 2 of the Linux Hamachi client exists and is currently in beta. It is available from the labs page on the Hamachi website; however, the vendor's tarball requires LSB and will not install correctly. You should use the logmein-hamachiAUR package from the AUR instead.

Configuration

Set Up Tun

Being as section above can only be applied for init.scripts, in order to install the module, as root run:

# modprobe tun

Then add tun to the list of modules by using your favorite text editor and Create

/etc/modules-load.d/tun.conf 
#Load tun module at boot.
tun

Hamachi 2 (beta)

Hamachi 2 is configured in /var/lib/logmein-hamachi/h2-engine-override.cfg (create that file if it doesn't exist). Unfortunately, it isn't easy to find a comprehensive list of possible configuration options, so here are a few that you can use.

Using the hamachi command line tool as a regular user

In order to use the hamachi command line tool as a regular user, add the following line to the configuration file:

Ipc.User YourUserNameHere

Automatically setting a custom nickname

Normally, Hamachi uses your system's hostname as the nickname that other Hamachi users will see. If you want to automatically set a custom nickname every time Hamachi starts, add the following line to the configuration file:

Setup.AutoNick YourNicknameHere

You can also manually set a nickname using the hamachi command line tool:

# hamachi set-nick YourNicknameHere

However, this needs to be done every time Hamachi is (re-)started, so if you always want to use the same nickname, setting it automatically (as explained above) is probably easier.

Running Hamachi

Start up the (matt) daemon

$hamachi start

or, if you use systemd

#systemctl start logmein-hamachi

Now you have a whole bunch of commands at your disposal. These are in no particular order and are fairly self explanatory.

$hamachi set-nick bob
$hamachi login
$hamachi create my-net secretpassword
$hamachi go-online my-net
$hamachi list
$hamachi go-offline my-net

To get a list of all the commands, run:

$hamachi ?

Note: Make sure you change the status of the channel(s) you are in to "online" if you want to perform any network actions on computers in there.

Systemd

The logmein-hamachiAUR AUR package also includes a nice little Systemd daemon.

If you feel like it, you can set Hamachi to start at every boot with Systemd:

systemctl enable logmein-hamachi

To start the Hamachi Daemon immediately, use this command:

systemctl start logmein-hamachi
Note: If for some reason, hamachi doesn't have a Systemd daemon, you can use one from here.

GUI

Various GUI frontends for Hamachi are available in the AUR.

For Hamachi 1:

  • haguichi (Gtk2, mono)
  • ghamachi (Gtk2)
  • hamachi-gui (Gtk2)

For Hamachi 2 (beta):

  • quamachi (Qt4)
  • haguichi (Gtk2, mono)

Troubleshooting

Hamachi times out soon after launch

If hamachi stops working after a short period of time it can be that the client is timing out. Create ~/.hamachi/config and add the following to it:

KeepAlive 10

If you have problems connecting to some hosts

Check if they are using Hamachi 2. If that is the case, then it is a known issue with the Hamachi 2 client connecting to the Hamachi Linux client.

/etc/init.d/logmein-hamachi is not found

Replace that path with /etc/rc.d/logmein-hamachi.

Error when trying to run hamachi-init

If there is an error while trying to load libstdc++.so.5, you want to install it. This library can be found in the extra repository, so you can install it by running pacman -S libstdc++5.

If you get an error while trying to load libcrypto.so.0.9.7, a temporary solution is to create a link from /usr/lib/libcrypto.so.0.9.7 to /usr/lib/libcrypto.so by running ln -s /usr/lib/libcrypto.so /usr/lib/libcrypto.so.0.9.7.

See also