1) It will allow remote access to the system configuration web page and ssh terminal without opening or forwarding ports
2) Soft phones can be used remotely connected to the system as though they were in the office. This is invaluable for remote users
The installation of hamachi is done from the command line, so to begin with log into the console of your system through ssh. Once logged on change folders and download the hamachi software.
- Code: Select all
cd /usr/src
wget http://files.hamachi.cc/linux/hamachi-0.9.9.9-20-lnx.tar.gz
We'll then extract the files and tidy up the folder.
- Code: Select all
tar -zxvf hamachi-0.9.9.9-20-lnx.tar.gz
mv hamachi-0.9.9.9-20-lnx hamachi
rm hamachi-0.9.9.9-20-lnx.tar.gz
To install hamachi go into the folder and run the following:
- Code: Select all
cd hamachi/
make install
tuncfg
Tuncfg installs the required hamachi network adapter. Next in order to have hamachi run at start up we need to create and edit a few scripts.
- Code: Select all
hamachi-init -f -c /etc/hamachi
hamachi -c /etc/hamachi start
hamachi -c /etc/hamachi login
Hamachi needs a network name and password that will be used when other join this virtual network. To create a new network change network and password in the below code to suit your needs. We will cover joining an existing network later.
- Code: Select all
hamachi -c /etc/hamachi create network password
You have now created a new hamachi VPN network that you will be able to join this machine and other users too. To join the phone system to the network we need to give it a name. Change "asterisk" in the below code to whatever you want to call your system.
- Code: Select all
hamachi -c /etc/hamachi set-nick asterisk
Once named we can then join the network so the system is accessible, replace "network" below with the name you gave your network .
- Code: Select all
hamachi -c /etc/hamachi go-online network
You have now created and joined your VPN network, in order to have hamachi run on start up we need to create a startup script
- Code: Select all
vi /usr/bin/hamachi-start
once open press "i" to insert code and copy paste this script into the file
#!/bin/sh
hamachi_start() {
echo "Starting hamachi..."
/sbin/tuncfg
/usr/bin/hamachi -c /etc/hamachi start
}
hamachi_stop() {
echo "Stopping hamachi..."
killall tuncfg
/usr/bin/hamachi -c /etc/hamachi stop
}
hamachi_restart() {
hamachi_stop
sleep 1
hamachi_start
}
case "$1" in
'start')
hamachi_start
;;
'stop')
hamachi_stop
;;
'restart')
hamachi_restart
;;
*)
hamachi_start
esac
Press "esc" and then ":wq" (without the quotation) to write and save the file. We then need to make it executable so it can run.
- Code: Select all
chmod a+x /usr/bin/hamachi-start
Next we need to add it to the start up options. Open up rc.local and add this code to the file.
- Code: Select all
vi /etc/rc.local
Press "i" (without the quotation)and then paste the following at the bottom of the file
if [ -x /usr/bin/hamachi-start ]; then
. /usr/bin/hamachi-start
fi
With this added you will have hamachi automatically start with the rest of the system.
