How to Configure Wake on LAN (WOL) and Broadcast Magic Packets

Most motherboards have a feature that I have been aware of for some time but have not tried until recently. It is called wake-on-LAN (WOL) and gives you the ability to wake a computer simply by sending it a “magic packet” from any other machine on the local area network (LAN). A magic packet is a data packet that contains the hexadecimal sequence FF FF FF FF FF FF followed by sixteen repetitions of the target computer’s MAC address. I implemented this feature on the Ubuntu LAMP server that I use at home. Now, I simply open a terminal and type a one line command to turn on my server. If you want to activate WOL on your computer I give you some pointers below.

Configure Your BIOS and Hardware for Wake-On-LAN

Although not every motherboard supports WOL, most ATX motherboards do. To determine if your machine does, enter your BIOS configuration screen. Look around for a WOL setting and enable it if you find it. My BIOS does not have such a setting. Instead I had to navigate to the power management settings and enable a feature called “awake from RING/LAN” (sometimes called “power on from MAC”). If your network interface card (NIC) is in a PCI slot you may also have to enable a power management feature called something like “wake on PCI”. I also had to connect my PCI NIC to my motherboard using a 3-pin wire. If you also have a PCI NIC it should have come with this wire and your motherboard manual should show you were the correct 3-pin interface is located. If your NIC is built in to your motherboard you don’t have to worry about this.

Determine MAC Address and Install Magic Packet Software

If you have managed to configure your BIOS correctly, the rest should be fairly easy. Determine and write down the MAC address of the NIC in the machine you wish to wake. If you are using Linux type ifconfig in a terminal and you should see a 12-digit alphanumeric address that looks like 0A:2B:3C:4D:5E:6F somewhere in the output. If you are using a Mac go to System Preferences > Network > Built-In Ethernet and click on the Ethernet tab and you will find the MAC address in a line tagged Ethernet ID. If you are using a Windows machine you have my sympathies.

The final step is also the one that gives you the most choices. You must find a program that will allow you to broadcast the `so-called’ magic packet to the machine you want to wake. I use a Perl script called wakeonlan by José Pedro Oliveira. I highly recommend this script if you are comfortable with terminal commands. Installation instructions are on the download page. Alternatives to wakeonlan can be found here. Once the wakeonlan script is installed, use the the following command to wake your computer (of course, substitute you MAC address).

wakeonlan 0A:1B:2C:3D:4E:5F


WOL will only work if you computer was last powered off “softly”. For example, if your machine turned off due to a power outage WOL will not work. By default wakeonlan will send the magic packet to your router’s broadcast address (255:255:255:255) on port 9. Sometimes NICs listen for magic packets on a different port. If this is the case with your NIC then type wakeonlan -h to get instructions on specifying a different port. You can also send the packet to a specific IP address instead of broadcasting to all machines on your LAN. If you still can’t get WOL to work then you may have to configure your router to forward port 9 to the machine you wish to wake.

Leave a Reply

Your email address will not be published.