Many devices support Wake On Lan (WOL) which is a feature that allows a machine to be woken up if it finds itself in a suspended state - for example, when a PC with a WOL enabled network card (NIC) is powered off, the network card will still be put in a low-powered state. This feature has to be activated, usually from the BIOS and allows a "magic packet" to be sent on the data link layer (layer 2 in OSI) (can be IPX, IP - TCP, or any other but UDP is the most common) and broadcasted within the network. When a network device that supports WOL receives the packet the NIC will signal the PC's power supply or motherboard to wake up the system.
The MagicPacket™ that is sent over the network, IP header aside, contains the following payload:
As an example, given a MAC address 9d:1a:01:20:1c:51
and a password minuet
, the data payload sent in hexadecimal will be:
FF FF FF FF FF FF 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 9d 1a 01 20 1c 51 6d 69 6e 75 65 74
where:
6
bytes are all 255
or FF FF FF FF FF FF
in hexadecimal16
repetitions of the 48-bit MAC address.6
byte password for the SecureOn™
(Depending on the manufacturer, one can determine what WOL features the hardware supports.
On Linux, this may be accomplished by installing ethtool
and issuing:
ethtool eth0
where eth0
is the interface to be queried. This returns something like the following:
Supports Wake-on: s Wake-on: d
where the letters represent (retrieved from ethtool
's man page):
WOL (ethtool ) | Description |
---|---|
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™. |
s | Enable SecureOn™ password for MagicPacket™. |
d | Disable. |
For example, to enable waking on magic packets using ethtool
, issue:
ethtool -s eth0 wol g
where eth0
is the interface that will receive the packet.