Showing posts with label vpn. Show all posts
Showing posts with label vpn. Show all posts

April 28, 2017

Replace/Supplant/Overwrite Hamachi with ZeroTier-One

vpn

Wait there just one moment -- you mean to tell me I never posted about replacing Hamachi for something in “orders of magnitude” better?!!? How absurd of me.

Purge that crippled software and reconstitute with ZeroTier-One immediately! ZeroTier is cross-platform and even works on my obsolete Synology 410j. Forget Hamachi FOREVER!

Free Versions of Hamachi ZeroTier-One
Nodes per network 5 100
Bandwidth Low High
Dropped Connection Often Rare †
IP Assignment Auto-assigned Auto-assigned or Static
IPv4 Subnets 25.*.*.* 10.147.17.* 10.147.18.* 10.147.19.* 10.147.20.* 10.144.*.* 10.241.*.* 10.242.*.* 10.243.*.* 10.244.*.* 172.22.*.* 172.23.*.* 172.24.*.* 172.25.*.* 172.26.*.* 172.27.*.* 172.28.*.* 172.29.*.* 172.30.*.* 192.168.191.* 192.168.192.* 192.168.193.* 192.168.194.* 192.168.195.* 192.168.196.*
IPv6 yes RFC4193 (/128) & 6PLANE (/80)
Traffic Filtering Client Firewall Custom traffic and protocol (“Flow”) rules with v1.2.x
SourceCode Closed Source Open Source and freedom loving
Free Support Forums; but often goes unanswered Support button on website, Knowledge-Base, and Forums; Super responsive

† The only time my connection dropped, was when ZeroTier versioned from 1.1.4 to 1.2.x and a couple of my clients had to be re-authorized & re-IP’d via WebUI. Doing so put them back online without touching the clients. Now that’s cool.

I'm syncing files over my ZeroTier VPN now.  You could consider replacing DropBox and BTSync with SyncThing. See my previous post for a quick and dirty install.

Other cross-platform Hamachi alternatives that I have not tried (because ZeroTier-One just works!) :
- SoftEther VPN
- tinc vpn
- FreeLAN
- NeoRouter Free (as opposed to the Mesh and Pro versions)

~~~~~~~~~~~





meanwhile back at the batlab
$ sudo aptitude purge logmein-hamachi
The following packages will be REMOVED:
logmein-hamachi{p}
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 2,867 kB will be freed.
Do you want to continue? [Y/n/?] YYYYYYY
(Reading database ... 105225 files and directories currently installed.)
Removing logmein-hamachi (2.1.0.86-1) ...
Stopping LogMeIn Hamachi VPN tunneling engine logmein-hamachi *
Removing any system startup links for /etc/init.d/logmein-hamachi ...
/etc/rc0.d/K49logmein-hamachi
/etc/rc1.d/K49logmein-hamachi
/etc/rc2.d/S11logmein-hamachi
/etc/rc3.d/S11logmein-hamachi
/etc/rc4.d/S11logmein-hamachi
/etc/rc5.d/S11logmein-hamachi
/etc/rc6.d/K49logmein-hamachi
Purging configuration files for logmein-hamachi (2.1.0.86-1) ...

Current status: 5796 new [-1].
$ echo "joy"
~~~~~~~~~~~
Partially written with StackEdit.

May 26, 2015

Automated Hamachi Reset BASH Script

On occasion, Hamachi may be in a failed state on your always-on device. Alternately, maybe when awaking from sleep-mode, Hamachi may not be functional but still reporting online.

Thusly, it might be very useful for a cronjob to check the state and reset. This might especially be useful on your remote machines that you need connectivity to. For example maybe a remote machine that is in sleep mode, but WOL is possible from another remotely-accessible LAN device.

I have written a BASH script for checking Hamachi and forcing re-login if necessary. Maybe this script is not all-encompassing, but it’s a good start.

Let’s assume you have 2 or more client IP’s and also assume they are in an always-on state. (If for example you have 4 clients, but only 3 remain always-on, you will only use the 3 that you expect to be on.)

Below is my script which you will need to edit (IP addresses and hamachi network name). It will ping each hamachi neighbor and only reset if ALL are unreachable.  Alternatively it will go-online-only if failures>0 and failures<neighbors.

This script uses bash installed from Entware-NG or Optware or Optware-NG. You will have to heavily modify this script if you prefer the built-in ash shell that is default with Synology.
You should edit, save, and mark the script executable.  (e.g. chmod +x ~/scripts/check-hamachi.sh).

Since the script executes sudo /etc/init.d/logmein-hamachi start , you must add the command to your sudoers file:

Run the command EDITOR=nano sudo visudo and AT THE VERY LAST LINE (or elsewhere if you know what you are doing) add:
 username ALL=(root) /etc/init.d/logmein-hamachi , where username is your account.

Lastly cronjob (crontab -e) it to every 5 minutes under your own user account. (e.g.:*/5 * * * * ~/scripts/check-hamachi.sh)

As always, Good luck!
---

Please consider crypto tipping:
  

April 14, 2013

Holy X11 Batman (RDP via ssh X11Forwarding from an OSX host over VPN -- it's true!)

Can it be true??? YES it IS... with a caveat I hope you solve for me...
The caveat is with a Linux client; I've verified OSX to OSX has no issue.

Scenario: I wanted to ssh into my Mac Pro at work from my Linux box at home and launch RDP via X11Forwarding.  Of course, from-Linux to-Linux is a non-issue, but in this case my host is OSX.  I got to playing, and the surprise was joyous.


Setup/Prerequisites:
 Client: Linux or OSX
 Host: OSX 10.8
 VPN: Hamachi (Hamachi for Linux in Labs)
 RDP Client: FreeRDP via OSX HomeBrew
 X11: XQuartz will be required for both OSX Hosts and OSX Clients.  Of course X11 is already part of any Linux Desktop Environment.
 Host firewall's ssh port 22 open for NIC "ham0"


Assumptions/Prerequisites:
 Let's assume you've installed XQuarts on the OSX host already.
 Let's assume you have Hamachi fully operational on both machines. (i.e. hamachi logged in, VPN created, joined on both machines, firewall open for ham0) -- ("hamachi list" to see your IP's, "hamachi -h" for other options).
 Let's assume you've installed Homebrew on the host already. (or you can do it while ssh'd in).

We will do this remotely through the hamachi VPN.

From your linux client, ssh into your OSX host: (If on an OSX client, XQuartz's xterm is necessary)
 ssh -XC user@hostIP #(-X is for X11 forwarding, -C is for compression)

Edit the ssh server config:
 sudo nano /etc/sshd_config
Adding the following 3 lines to the end of the config file:
 AddressFamily inet #(required when IPv6 is disabled on any client or host)
 X11Forwarding yes
 X11DisplayOffset 10

Restart the sshd service:
 ps -ef | grep sshd | awk {'print $2'} | sudo xargs kill -HUP
 
This will have disconnected you, so ssh in again:
 ssh -XC user@hostIP

Let's install FreeRDP:
 brew install freerdp

Setup the display for the X11Forward:
 export DISPLAY=localhost:10.0

Now run xfreerdp:
 xfreerdp serverIP #(where serverIP is a legitimate internal network IP)
 #OR
 xfreerdp -u username -d domain serverIP  #(where -d domain is only needed for Active Directory members)

Proof:

Caveat:
  I've found a significant issue strictly when on Linux client-side --  When i type into the RDP session I get completely different characters making the session unusable.

Here I type "Administrator":

I'm sure it's a keyboard or character set issue.  I'm looking into the xfreerdp -k option, but have not solved it yet.  If you solve my problem, PLEASE post it in a comment.  Thank you, and good luck!
------------
Please consider crypto tipping:
  

February 11, 2013

Cisco VPN via Network-Manager applet in XFCE4 Debian

Fighting VPN configuration in Debian Wheezy lead me to post these notes.

Even after installing network-manager, network-manager-gnome, network-manager-vpnc, and adding a VPN, actually launching it failed -- no authentication dialog would show.

It was definitely a GUI issue as running vpnc from commandline succeeded.

As a test, run sudo vpnc --gateway <gateway-IP> --id <cisco-group-id> --username <username>
To disconnect use: sudo vpnc-disconnect
If you can connect, you know your vpn subsystem is operational.

So first install the necessary components: sudo aptitude install vpnc vpnc-scripts network-manager network-manager-gnome network-manager-vpnc network-manager-vpnc-gnome

To permanently add the nm-applet to your panel, in XFCE, go to Applications(Menu)>Settings>Session and Startup>Application Autostart tab and enable "Network". This will add the applet upon next session start. You MUST have the "Notification Area" applet added to the panel.

To temporarily show the applet without logout or restarting, run nm-applet & ; exit
Now initially, Network-Manager will not be managing your connection, so edit the config to enable management of your existing wired connection. For me this was named "ifupdown (eth0)": (reference) sudo nano /etc/NetworkManager/NetworkManager.conf and set in the config file managed=true
Then restart the network-manager: sudo /etc/init.d/network-manager restart
Now add your VPN settings and everything should work as expected.
---------
Please consider crypto tipping: