WoL is a handy tool when you have servers hosted in data centers and comms rooms or stored in your loft/basement that aren’t always easily accessible to turn on and off.
To enable wol in linux follow these steps
sudo apt-get install ethtool
sudo ethtool eth0 -will tell you if your NIC compatibility
Sets Wake-on-LAN options. Not all devices support this. The argument to this option is a string of characters specifying which options to enable.
p Wake on phy activity
u Wake on unicast messages
m Wake on multicast messages
b Wake on broadcast messages
a Wake on ARP
g Wake on MagicPacket(tm)
s Enable SecureOn(tm) password for MagicPacket(tm)
d Disable (wake on nothing). This option clears all previous options.
Save the following into a bash script:
ethtool -s eth0 wol g
And set to run at boot:
sudo update-rc.d [wol_script] defaults
You can then easily wake the machine by sending a magic packet to the LAN broadcast address with the server’s MAC address inside: