Wake on LAN
I posted an article about Wake on LAN (WoL) about seven years ago, which has since generated a good amount of discussion in our forums. It seems this is a technology of interest and why wouldn't it be? Wake on LAN is a useful tool to turn on a computer over a network. It allows you to leave your computer off for security, power saving or other reasons, yet turn it on without physically pressing the button on the device.
In this follow-on article, I'm going to discuss the details of the magic packet a bit more, as well as discuss how the magic packet may turn on a remote device over both wired and Wi-Fi networks.
As a brief review of my last article, WoL uses a "magic packet" containing the broadcast MAC address ff:ff:ff:ff:ff:ff followed by sixteen iterations of the target device's MAC address. A network interface card (NIC) and PC configured to monitor for the magic packet will turn itself on when it sees it.
To understand the magic packet better, it is useful to look at the packet itself. When the packet is sent over a LAN, it is simply sent as a Layer 2 frame, with the sending PC's MAC address as the source address and either the target PC's MAC addresss or the broadcast MAC address as the destination address.
You can examine these details by generating a magic packet with Wireshark running on your PC. A free command line utility I've successfully tested that generates a magic packet is Matcode's mc-wol executable, available here. Simply typing mc-wol [target computer MAC address] will send the magic packet over the LAN. For example, to wake up a PC on a LAN with a MAC address of 00:1C:23:01:02:2D, you would type mc-wol 00:1C:23:01:02:2D from the command line (CLI).
You'll see in Wireshark screenshot below, that the MC-WOL utility created a magic packet with my running PC's MAC as the source address and the broadcast MAC address as the destination address. You can also see the contents of the packet, with "ff ff ff ff ff ff" followed by sixteen iterations of the target PC's MAC (00 1c 23 01 02 2d).
A key step for this to work is enabling WoL in both your BIOS and Operating System, as shown in the below screenshots taken from a Windows 7 PC. The first screenshot shows the WoL options from my PC's BIOS. As you can see, I've enabled WoL for both my LAN and WLAN interfaces.
Enable WoL in BIOS
In the screenshot below, I've enabled my laptop's Ethernet port for Wake Up Capabilities in the left window and enabled the wake up functionality in the Ethernet port's Power Management menu on the right.
Enable WoL in OS
It's easy to tell if your PC will support WoL. Before you enable WoL on the target PC, turn the PC off and look at the Ethernet port on the target PC and the Ethernet port on the router/switch it is connected to. If WoL is disabled, there will be no lights on the ports. Once you enable WoL in the BIOS and OS, you should see the link light ON on the Ethernet port on the target PC and the Ethernet port on the router/switch. For WoL to function, the NIC on your PC will stay on in a low power state, monitoring for a magic packet.
Below is an image of the Ethernet port on my laptop. The laptop is completely powered off, but notice the light on the Ethernet port next to the cable. (Note also that a laptop has to be plugged into power for WoL to work. WoL will not work while on battery power.)
Link Light is ON
This is a make or break step, but it doesn't always work. On one of my PCs, enabling WoL in both the BIOS and OS results in the NIC staying on, even when the PC is turned off. This PC successfully responds to a magic packet. I can consistently power on that PC with a magic packet from anywhere on my LAN.
On another PC, enabling WoL in both the BIOS and OS does not result in the NIC staying on. Subsequently, this PC does not respond to a magic packet. I suspect an issue on my second PC with either the BIOS or device drivers. No matter what the culprit is, the result is the same: no WOL!