Corporate servers are typically powered on 24×7 to serve incoming client requests. But if you’re running a simple server on your home network, you may wish to keep it in sleep mode until you actually need to use it. What’s the easiest way to wake the server up from sleep mode?
One option is to walk over to the server and press a key or click the mouse to wake it up.
A more convenient way is to configure Wake-on-LAN (WoL) so that you can send a “magic packet” from any device on your network to wake the server from sleep mode.
This post explains how to configure Ubuntu 14.04 (server) and Windows 8.1 (client) to support Wake-on-LAN.
Contents
Ubuntu (Machine to wake up)
Check BIOS Settings
First, check your BIOS settings to make sure that WoL is not disabled. To access your BIOS, you’ll need to restart your computer and hit one of DEL, F2 or F10 keys while it’s starting. If you cannot find a setting for WoL in the BIOS, don’t fret just yet.
My old Compaq laptop had no setting in the BIOS for WoL, but Ubuntu supported it nonetheless.
Check Ethernet Adapter
Second, determine whether or not your Ethernet adapter supports WoL by issuing the following command in a terminal window:
sudo ethtool [NIC]
Where [NIC] is the Ethernet adapter that is connected to your home network. For example:
sudo ethtool eth0
In the output, make sure there is a ‘g’ in the letters beside “Supports Wake-on”. For example:
Supports Wake-On: pg
Then check the output beside “Wake-on:” to see if Wake-on-LAN is enabled. If the output contains a ‘g’ then it is enabled.
Wake-on: g
Further information can be found in Ubuntu’s online documentation.
Determine MAC Address
Finally, determine the MAC address of your Ethernet adapter. Use the command:
ifconfig [NIC]
For example:
ifconfig eth0
In the output, the MAC address should be printed beside “HWaddr”. For example:
HWaddr 00:16:dd:00:00:01
Windows (The Waker Upper)
Download WoL Software
Download WakeMeOnLan from Nirsoft and extract the files to your desktop.
It comes packed with only three files (two help documents and the program executable itself).
The program has an intuitive user interface from which you can scan your network for active hosts and send wake up messages. But to make the process even more simple, let’s create a one line Windows shell script on the desktop that will execute WakeMeOnLan with the MAC address of your server.
Create Shell Script
Add the following to notepad and save it to the desktop with a .cmd extension. The WakeMeOnLan executable must be on the desktop as well.
# Wake up Ubuntu server WakeMeOnLan.exe /wakeup 00-FF-00-FF-00-FF
Where “00-FF-00-FF-00-FF” is the MAC address of the Ethernet adapter belonging to the machine you want to wake up.
Now all you need to do is double-click the wakeup.cmd script and it will send a message to the sleeping Ubuntu machine, causing it to wake up!