Your Ad Here

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

Old Analog Computer

Most modern 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. If you are wondering what exactly a magic packet is it 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 LAMP server that I use for web development at home. It is awesome. Now I don’t have to get off of my lazy butt and walk up a flight of stairs to power on my server. I simply open a terminal and type a one line command. 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

Troubleshooting

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.


5 Comment(s) rss

  1. Thanks for the tip. It took me a while to get my Asus P5N-E SLI working with Wake On LAN but in the end the fix was simple.

    sudo ethtool -s eth0 wol g

    Then shutdown and now the magic packet works!

    graham | Nov 19, 2007 | Reply

  2. @graham - Thanks for the comment. I forgot to mention in the post that some ethernet cards require software activation of wol capabilities.

    Sam | Nov 19, 2007 | Reply

  3. The MAC address of a Windows machine is easily determined by Using the Run command from the Start Menu. Open a “DOS” window by typing “CMD” in the RUN textbox. When the window opens type
    IPCONFIG /ALL. The MAC address of all interfaces will be displayed. Note: I am not visiting this site because of any great fondness for MS products!

    Bill | Mar 31, 2008 | Reply

  4. I got a problem with my setup. I configured WOL on my server 2003 ENTerprise, the server turns on, but when is booting up it freezes when loading windows You know! when the process bar is running accross the screen

    cisco | Apr 21, 2008 | Reply

  5. @cisco - Since your machine powers on and begins booting, the problem is most likely not due to waking the machine via LAN. Your problem is most likely Windows related. I’m afraid I can’t be of much help to you figuring this problem out. Good luck.

    Sam | Apr 21, 2008 | Reply

Post a Comment rss

Not sure if your comment is appropriate? View our comment policy here.

© Copyright Zaphu 2007. All rights reserved. -- Valid XHTML

Sitemap XML Sitemap XHTML