2011
01.30

Wake on LAN

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

Install ethtool:

sudo apt-get install ethtool

sudo ethtool eth0 -will tell you if your NIC compatibility

wol p|u|m|b|a|g|s|d…
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:

#!/bin/bash
ethtool -s eth0 wol g
exit

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:

wakeonlan 00:11:22:aa:bb:cc

No Comment.

Add Your Comment