Sunday, March 13, 2011

Wake-on-Lan (WOL) for Windows 7 Made Easy!

**will delete this link after 2012



This was such a nightmare to troubleshoot that I just had to document the process. In my scouring the web, I found many like me experiencing the same woes in setting up their WOL. My whole purpose for doing this was in the interest of saving power. I could put my computer to sleep and still be able to wake it up remotely so I can RDP (Remote Desktop Protocol) into it to access my files while away. [EDIT: I recently found this great article on WoWLAN by Andrew vonNagy which details some of the benefits and downsides to using this technology, and provides a nice cost analysis for an organization case study. Check it out if you're interested in the Wireless WOL.]

There are numerous steps to the process, so I'm first going to outline all of them to give you a nice overview of how to get setup. Henceforth I will refer to the Wake-on-Lan capability as WOL. Here is a zipped file with  shortcuts to all the Control Panels you'll need for your convenience. It also contains a script for the WOL utility linked at the end of this article. ;)

COUPLE QUICK NOTES BEFORE WE BEGIN
  • WOL ONLY works for Ethernet (i.e. hard-wired) connections, NOT Wireless!
  • You must use the MAC address of you Ethernet card.
  • Orange bullets relate to enabling WOL feature / services.
  • Green bullets relate to the actual routing of the packets to your computer.
  • Things you'll need to know about your computer: LAN IP, WAN IP, and MAC address. Real quick, hit Windows key + R and type 'cmd' then enter. In the console type 'ipconfig /all' and enter. Look for your "Ethernet card" and write down its IP (i.e. LAN IP) and MAC address. Then head to whatsmyip.org to get your WAN IP and write it down as well.
  • This guide is designed so you don't have to read everything, but only refer to the sections where you're stuck or having issues. The troubleshooting tools at the bottom can help you deduce what is wrong.
OUTLINE
  • Enable WOL in BIOS (from boot)
  • Enable WOL for your Ethernet Card (i.e. NIC)
  • Install Windows Feature "Simple TCPIP services"
  • Start Service "Simple TCP/IP Service" (enables ports 7 & 9)
  • Open UDP for Port 9 in Windows Firewall
  • Forward the port on your Router
  • Testing / Troubleshooting Tools
ENABLE WOL IN BIOS
Because of all the various motherboards out there, I'm not going to go into how to enable WOL in your BIOS, only know that you need to. However, if your BIOS, like mine, is severely limited in settings and no option is available to enable WOL, it might be safe to assume that it will work by default. My HP laptop has many of the BIOS settings locked for warranty purposes, but despite not having the option available, I am still able to use the feature.

ENABLE WOL FOR YOUR ETHERNET CARD (I.E. NIC)
Open "Device Manager" from the control panels or use the link in the zip. Expand "Network Adapters" and find your Ethernet Card. Right-click and open "Properties" then go to the "Advanced" tab. You should see something similar to the following. You want to enable "Wake on Magic Packet" or something similar.



INSTALL WINDOWS FEATURE "SIMPLE TCPIP SERVICES"
Open "Programs and Features" from the control panels or use the link in the zip. Click "Turn Windows features on or off" over on the sidebar. Scroll down and check "Simple TCPIP services" then click OK to install the feature.


START SERVICE "SIMPLE TCP/IP SERVICES"
Open "Services" from the "Administrative Tools" control panels or use the link in the zip. Scroll down to the service for which we just installed the feature. Make sure the service is started by clicking the link in the sidebar. Also ensure that the "Startup Type" is set to "Automatic" so that it will run with Windows.


OPEN UDP FOR PORT 9 IN WINDOWS FIREWALL
Open "Windows Firewall" from the control panels or use the link in the zip. Only UDP is needed, but you can if you with open the port for TCP as well. This is because UDP is a broadcast packet which can always be received by your NIC, whereas TCP requires the computer to be powered up. This can also be set to limit the IPs which can use the port and other security features to make your computer less vulnerable. These are the easiest settings.


FORWARD THE PORT ON YOUR ROUTER
You should see your routers' manual for the details, but here are the basics. Your router IP is almost always 192.168.1.1 or 192.168.0.1. Enter your router IP into the address bar in your web browser (Chrome ftw :P) and login to the admin page. Once there, you will find a section called something like "Advanced."  What you are looking for is the "Port Forwarding" section. Make sure you forward port 9 to your LAN IP that we got earlier.

TESTING / TROUBLESHOOTING TOOLS
  • wakeonlan.me - Can auto send you magic packets on a schedule though the schedule is messed up. I had to set the schedule time to EST while keeping the timezone set to my timezone. It's quirky, but it works. When you get the schedule set correctly is should tell you how many minutes before it sends the packets at the top. Alternately you can use another computer on your LAN to test it, but be sure to use your computers' WAN IP address to ensure it actually works from outside your LAN.
  • Wake-on-LAN Packet sniffer v1.1 (direct download) - This nifty little free tool was incredibly useful when paired with the above site to verify that the magic packets were actually getting through to my computer.
  • Wake-on-LAN Utility (direct download) - This is what you'll be using from your remote location to send the magic packet which will wake up your computer. There are other utilities like this available, but I like this one. It's simple. I will also include a batch script in a separate zip which will make your life easier. You'll only have to edit the script to put your computer MAC and WAN IP.
  • whatsmyip.org - The indispensable tool for ensuring that your port is open to the outside world. Will only show open TCP ports. Not UDP as is used for WOL.
READER SUGGESTIONS
  • Android app with excellent reviews called "Wol Wake on Lan Wan" by Brobble, available on Android Market. (thanks to Emad)

Updated 15-Jan-2012
Fixed broken link to download my script pack. Thanks Anonymous chat user :)

26 comments:

  1. Dude, thank you so much for posting this up. I seriously gave up on this a while back, but thanks to you I finally got my WOL working! Kudos!

    ReplyDelete
  2. I had used WOL before but this little post had me up and running in less than 5 minutes. It's the simple things that bring a grin to my life.

    Abe Diaz

    ReplyDelete
  3. Awesome post! In a simple language made the hard tech configurations simple and easy.

    Thank you for the support man!

    Brgrs,

    Paulo F.
    Brazil

    ReplyDelete
  4. Thanks for the post Matthew. Just a few quick notes. A lot of the steps above aren't actually required - the process of -

    1. Install Windows Feature "Simple TCPIP services"
    2. Start Service "Simple TCP/IP Service" (enables ports 7 & 9)
    3. Open UDP for Port 9 in Windows Firewall

    are only just a way of making a hole in the firewall so that the program you use to detect the magic packet will work. It's not actually required to wake the machine. You could just as easily disable the windows firewall while you do the wolsniffer testing and then once you have successfully received a packet, you can switch it back on again. In the real WOL system, the OS doesn't receive the packet (as the machine is switched off), only the network card does.

    One thing that you DO need to do it configure your BIOS so that the PCI-e is made live for WOL packets. You MUST have a network link light on your ethernet even when the PC is switched off. If there is no link, there is no way for the PC to receive the magic packet.

    ReplyDelete
  5. Thanks so much for this tutorial, Matthew. I've got everything working and it's great. I am wondering, however, if there's an easier way to send a the wake command than having to open a CMD panel, and type in the entire MAC address of the target machine (that's a lot of numbers to type every time). I'd also prefer not to schedule sending magic packets on a regular basis (as is suggested with the wakeonlan.me prog above). Is it possible to configure a shortcut icon to send the wake command magic packet to the specified computer?

    ReplyDelete
  6. Found the answer here: http://liveinformant.com/pc/wake-remote-pc-setup-wol/

    To do this, simply take the command you used to Wake your PC and copy it into notepad.

    Example: C:\mc-wol.exe 01:2C:21:E3:D8:5F

    Now save the text document somewhere on your PC.

    Rename the file from .TXT to .BAT. You have now created a simple batch file to execute your Wake On LAN command so that you do not need to retype it each time, or remember your MAC address.

    (I save this file into my C: directory along with the mc-wol.exe program for convenience.)

    You can now double click this file to run the Wake On LAN request for your remote PC. To make it even more convenient I recommend creating a shortcut to this file on the taskbar of your PC.

    If you “right click” on the shortcut and select “Properties” you can use the “Change Icon” button to make the shortcut easy to identify as your WOL button.

    ReplyDelete
  7. @marvy: You're absolutely right, I appreciate your pointing that out. Perhaps I'll update this later to trim the fat a bit more for future readers ;)
    @The Invisible: Yes sir, just as you suggested. I also included a batch file in the script pack I posted for download in the first part of the article. Cheers!

    ReplyDelete
  8. I have done all of above, and still I have big trouble making WOL and wolsniffer work. I get a socket() failed with error 10013 on W7 SP1, but not on WinXP. Any help appreciated.

    ReplyDelete
  9. I have done everything above and i can receive the packet on my home computer....but it doesn't seem to wake my computer up....what am i doing wrong???

    ReplyDelete
  10. Hi. I use WIndows 7-64 bit. I have strange problem.
    When I set network card settings:
    "Alow the computer to turn off the device to save power"
    Computer is Waking up, but after windows boot, there is no network conections and untill disable and enable network card there is NO conection.

    If I uncheck "Alow the computer to turn off the device to save power".I can't wake computer form internet, but if I wake with pressing key from keyboard, computer is boot normal and Network conection is working.

    I try 2 different network card and 2 different router, so the problem must be in Windows configuration.

    I hope someone can help me

    ReplyDelete
  11. @OlsensHorse & @frogger: Perhaps you could chat with me and I could help you troubleshoot this.
    @Stefan: Well the sure-fire way would be to do a clean reinstall of Windows, which I'd recommend at least once a year anyway, but if you don't like that idea give me a chat and hopefully I can help you troubleshoot it if I have time. You may find this article useful as well. ;) http://www.sevenforums.com/network-sharing/93220-cant-enable-wireless-wol.html

    ReplyDelete
  12. OlsensHorse: Right click on the program and select "Run as Administrator"

    Thank you for this guide! I have followed all of the steps, but I still can't get my WOL to work correctly. Using the sniffer, the computer detects the packets just fine. I have enabled the WOL feature in the BIOS, and on the device properties I made sure that the correct options were correct, yet the computer still doesn't wake up when the magic packet is sent. Looking on the computer itself, I can see the LED's on the network connection on, so I know the card gets power when off. Do you have any other suggestions of things to check?

    ReplyDelete
  13. THANKS for this guide! Brilliant. One note if you are having trouble port forwarding to the internal broadcast address x.x.x.255, it worked on one of my routers but not another (even though it did let me add it). I used some info from here (http://www.dd-wrt.com/wiki/index.php/WOL#Remote_Wake_On_LAN_via_Port_Forwarding). I added a port forward to an UNused IP on my LAN, then added a static ARP entry in router (using telnet) to link that UNused IP to FF:FF:FF:FF:FF:FF and it works from the Internet!!

    ReplyDelete
  14. A followup on my my problem: I got it working, but I had to update my network card drivers. I just let Windows do it for me (In the "driver" tab of the adapter window I clicked "Update Driver"). Once this was done, a few more options became available (such as "WakeOnLAN from PowerOff"). I made sure that was enabled, and now it works!

    Long story short: Update your drivers and try again if you seem to be stuck. My WOL initially would only work from hibernate, but not from shutdown, and now it works all of the time.

    ReplyDelete
  15. hello there!
    one of the best tutorials matthew i must say. thank you! But there is always a but..! i cant make it work. I tried everything.
    Let me say first that i want to wake up my pc over the internet and to be more accurate from apps i have on iphone (iWake, Depicus Wol) over 3G cellular network. On lan everything is fine.
    i followed your guide step by step, i made a hostname at dyndns.org put everything in place correctly but nothing happened.

    question: in this http://www.yougetsignal.com/tools/open-ports/ when i put port number 9 it says closed. is it right?
    question: with this sniffer i dont see my wake up calls but if i leave it open it sniffs other ones. is that right?

    thank you in advance... i havent got much sleep with this thing for nearly 3 days...

    ReplyDelete
  16. Matthew,

    Just another short note to add my thanks for a clear, concise guide on how to implement WOL.

    After I got this quickly up and running on my PC decided to splash out £1.49 for an iPhone app, iNet WOL, which worked straight out of the box thanks to the changes already made.

    Now getting remote access to my shut down PC is never more than a click away.

    Top man!

    ReplyDelete
  17. anyone else has tried to wake up his computer over 3G network???

    ReplyDelete
  18. Brand new Zotac Nano VD01 SFF HTPC and these steps worked like a charm... BUT... specifically with this PC, the WOL work to power it up, but not completely. The system is fully alive, but the screen stays dark ("no signal" changes to a black screen). Only after pushing the mouse the screen snap awake. Unfortunately, it's not just the screen - as Teamviewer, RDP, or VNC all show the computer as off line until the mouse is moved or any key is pressed. My other two PCs work just fine.

    ReplyDelete
  19. Well, i didn't got Port9 in UDP or rest in control panel. But I've a simple way to WOL at my own.
    Go Control Panel\Network and Internet\Network Connections. here's icon Local area connection just right click and 'Disable' it then again 'Enable' it; Lan is awake. {Magic}

    ReplyDelete
  20. In case anyone else can't fine a "Wake on LAN" entry in their network cards advanced settings, my Lenovo has an Intel 82552 10/100 network card, and there is no "Wake on LAN" entry. The correct entry to enable WOL for that card is "Enable PME".

    ReplyDelete
  21. You are very kind to share your knowledge. This guide helped me completely!

    It will only add the following steps (these are basic but necessary if you use the Software Restriction Policies in Windows 7, like me)

    I. To edit the wake.bat file must:
    1. Change its extension to .Txt
    2. Open it with Notepad
    3. Make the necessary changes
    4. Save the changes
    5. Change its extension to .Bat

    II. To run mc-wol.exe must:
    1. Create a folder named WOL (can be any other name)
    2. Copy the files wake.bat (edited) and mc-wol.exe to the WOL folder
    3. Copy or move the WOL folder to C:\Program Files
    4. Double clicking the file wake.bat (edited)

    Just saying, thank you very much and merry christmas!

    ReplyDelete
  22. Thanks so much for this, I've been struggling for days. It is always good to have clear concise explanation because even if this article does not solve every problem it allows you to know you are at least playing with the right settings.
    Anyway, got it working and would not have managed had it not been for this page.
    tjpearson

    ReplyDelete
  23. Matthew,
    I am running Windows 7 on iMac.
    WOL works fine on OSX withing network. But I can only put it to sleep or shutdown from outside, not wake.
    Anyways, its not doing any of it on Windows 7. I am receiving packets from my iphone app on sniffer from within network.
    One thing I have noticed is that the ethernet light remains on in OSX but it turns off in Windows when the system goes to sleep mode.
    Please help.

    ReplyDelete
  24. This comment has been removed by the author.

    ReplyDelete
  25. Hi Matthew,

    My computer is hard-wired to the Repeater (Asus RT10) with Ethernet cable, but the Repeater is connected to the Router (Linksys) wirelessly. Will Wake on Lan work in this situation?

    Thanks

    ReplyDelete
  26. Wake up On lan works but don't over wan... can't explain why
    - udp port is forwarded port 9 to my internal ip, also a higher port vor expamle 4444 for just in case.
    - windows firewall ports are also open.
    - using (NopIp) for dns name.
    - for waking up my pc i can test it only for now over 3G with mobile app wake up wan/lan.

    i entered in the app the correct mac, dns name and port.... still not working,,


    any ideas?

    thx

    ReplyDelete