Tuesday, December 17, 2013

Use Wake-on-LAN (WOL) on FreeNAS from external networks

Problem: need ability to wake up machines on one network from a remote / external location (and, not have to leave one machine on all the time in order to remote-in simply to wake another system). 
- WOL is not Internet friendly because most routers will not deal with this type of broadcast traffic (and some ISP's block it anyway).
- would like to be able to leave only the FreeNAS server running, for a variety of reasons. So, why not use it for WOL? This allows all other machines to sleep, until you need to access one. 

Here's one way to set it up:

  1. FreeNAS server^ - open source, excellent, low energy consumption (automatically lowers based on use); many, many features. If you have a USB stick (4GB+) and an old system, that's it! Using ZFS storage pools you can add old drives too.
  2. One or more machines with a (wired) NIC capable of accepting WOL "magic packet"
  3. Telnet app (we will be using Mocha Telnet Lite (free) for iPad/iPhone)
  4. Static IP of router in front of the machines you wish to wake (i.e. your home router), on the same network as the FreeNAS system (or, see OPTIONAL 'A' below)
    1. Admin access to the router, to setup port-forwarding for Telnet/SSH 22 (or your custom port, as configured in FreeNAS

OPTIONAL Components:
A. Dynamic DNS (DDNS) - visit DynDNS and sign up for Remote Access or the hosting package (the latter if you want to use your own or register a new domain), otherwise, simply pick one of the free domains offered (i.e. <yourname>.dyndns-remote.com:22 (or your custom port #))

  • DDNS should be configured on your router if you have other services (i.e. additional open ports). Alternatively, if you are only using the services offered by FreeNAS, then you can turn on DDNS service on that system (see Fig. 1 - enable SSH, below for reference)

B. Splashtop Remote client & Streamer  - this is our favorite "rdp" app. Using an iPad (or PC) you can quickly, easily connect to any number of remote machines; keep all of them "headless" if you like. The Splashtop Remote client will allow to a. see if the machine is awake, and b. connect to it!

The FreeNAS Setup: 
Once you have your FreeNAS system up and running, simply turn on the SSH service. 

Fig. 1 - enable SSH

Fig. 2 - Configure SSH (need root to execute 'wake')
set custom port here, if desired

Telnet configuration - again, we are using Mocha Telnet Lite, but the required information is similar for other apps or command line.
  1. Add the FreeNAS server and test your connection, ensuring that you can connect on port 22 (or whatever port you configured in Fig. 2, above).

Fig. 3 - setup a Macro

OPTIONAL: Setting up the Macro first will allow you to copy & paste the line needed to execute the 'wake' command, into a fake server config, so you can keep track of the macros, as they relate to each machine (Benefit - you will not need to remember each MAC address and type it every time*): 
Fig. 4 - add a fake server to store your macro, along 
with a name to define which machine has that MAC

With setup complete, try to login via Telnet and execute the command.
1. Login to the FreeNAS server:


2. Click 'Menu' from the bottom row of commands to access a Macro, or simply type the wake command with the correct interface (use ifconfig to identify the interface, if needed) and MAC address. 


3. Click 'Macro' - ideally your machine will be sleeping at this point.

4. Select the correct Macro from the list, as shown:


5. If the wake command executes correctly the cursor will simply return on a new line.
Now, using Splashtop (or VNC, RDP, et al) connect to the now awake machine to confirm that everything worked correctly. 

For myself, friends, family and customers, this setup works well (at nearly no cost, or no cost at all depending upon the options and software used). 

^note that we do suggest use of a battery backup (UPS) for the FreeNAS system and any drives connected to it. FreeNAS does support many different types (UPS/PDU)), through an included service (provided by NUT). If you do use one, simply open the Shell from within the FreeNAS UI and execute: 
upsc ups@localhost
This command will output the current status and configuration parameters. 

*one alternative to using the "fake server" approach would be to simply maintain a listing of MAC/Systems in a text file. But then you need to copy and paste and jump back and forth between apps. Since we normally use an iPad (or Samsung Tablet), our preference leans toward ease of use & efficiency. 

Monday, November 4, 2013

Three Great Apps for Your Mac

Having always been more of a Windows person, primarily due to work constraints over the years, I have been very, very happy with Mac's OS X. My Mac-Mini* is now on Mavericks, and although there are a couple of bugs I have been able to overcome these with some wonderfully simple, free or low-cost applications.    

1. Jettison ($4.95 direct, may be less through AppStore) - thankfully exists to eject any/all disks that you choose, prior to the OS entering a sleep state. This app seems to be essential for any Mac (definitely for laptops). The issue I and many others have found is the multiple sleep states (darkwake, et al) which cause the system to either not sleep or wake all too often. 

2. PleaseSleep (Donation-ware) - Seemingly counter to the whole idea of an operating system, there are several Apple apps/utilities/system processes that will prevent your Mac from sleeping. For me, this has been one of the most annoying issues when using my Mac-Mini. For example, I have deleted all the AirPlay files to prevent such issues, since I do not use any AirPlay device. Enter PleaseSleep  from DragonOne, genius! 
Summary Description from the developer:
"PleaseSleep is a utility software designed for Mac OS X that helps put your computer to sleep when you know some other app is preventing your Mac from going to sleep."
And that is EXACTLY what it does, plain and simple - it just works, with the tiniest footprint. 

3. FingerPrint - an "airprint" utility for iPad printing. It is based on Bonjour, so your iPad and your Mac must be on the same network, using the same subnet and in most cases be connected with only one switch/router (if you have more than one router on your network it will need to support Bonjour forward-broadcasts (pretty much only AirPlay stuff). 
NOTE: sadly this utility is no longer supported by the developer. They switched to Windows (to chase enterprise revenue) and a new app named Presto. I do use Presto on a Windows Home Server and it is more versatile than FingerPrint was, overall. Presto adds Google Cloud Print and other functions, such as allowing 
If you want to download the NO-LONGER-SUPPORTED version, click here. It does work well and includes both print to Dropbox and Open on My Mac (pdf to desktop).

3a. As an alternative you might want to check out Cloud Printer for Mac, which also works with Google. 

*I should mention that my issues with OS X and sleep are exacerbated by my use of the Mac-Mini as a "headless"system. While it is hooked up to an HDTV with a remote and wireless keyboard (with integrated touchpad), my main use is via an app called Splashtop (which to me is absolutely essential and the best-of-breed remote desktop software). Using this app I connect via my iPad, PC's or, occasionally my Android phone.