Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Wake-On-Lan not working after a long sleep

24 Sep 2013   #11
notoriousdds

Windows & 64 bit
 
 

I had this issue when I was first setting up my WOL. However, it now works flawlessly. Like everything, the answer lies in the details. Let me explain.

It's my understanding that when the computer is in S1 or S2 sleep (see earlier post in this thread from Parmer for definitions), an IP address can still be used for WOL. But, once it gets to S3 or S4 sleep, the computer essentially loses it's IP as an identifier. This explains why WOL might work right after the computer has been put to sleep, but not when the computer has been sleeping for a long time.

So, if you can't send the WOL signal directly to the IP of your computer your trying to wake, to what IP can you send it? The answer is that you need to send the WOL signal sent out to EVERY IP on the subnet. This is accomplished by sending the WOL signal out to xxx.xxx.xxx.255. (255 broadcasts to every device on a subnet.)

So, the WOL signal has to go out as a broadcast (aka xxx.xxx.xxx.255) and it has to contain 2 things:
1. The MAC address of the device you want to wake, and
2. The UDP port number for the NIC that's listening for the WOL signal (UDP port is usually 7 or 9 for WOL).

Herein lies the problem. You can generally configure a router to forward incoming data to any specific IP, but not all IP's. In other words, I've never seen a router that will port forward anything to the xxx.xxx.xxx.255. This is for good reason, but limits your ability to use WOL.

If you're only trying to send and receive the WOL signal within one subnet, you just need to follow the rules above and make sure that your NIC is configured properly (read on for an easy way to check.)

But, if you're trying to do this across different networks (i.e. over the internet), you'll need a router that is capable of sending out the WOL signal and you'll need a way to ask the router to do so.

So, how does one "ask the router to send out the WOL signal"? So long as the router is capable (many are not), you should be able to do it through the GUI interface on the router, or by connecting to it (via telnet or SSH) and executing the proper command. If your router is NOT capable or sending out WOL signals, you might be able to make it so by flashing the router with a third party firmware like DD-WRT, Tomato, etc.

The GUI method is easier to understand, but the telnet or SSH method allows you to write a little batch file that allows you to do WOL with a simple double click. (I won't get into this here.) Regardless of which method you use, when trying this from the internet, you'll have to configure your router to allow WAN connections to the GUI, telnet, or SSH interface before you'll be able to ask it to send the command.

Lastly, before banging your head against the wall trying to set this up, do an easy check to see if you NIC can even handle WOL:
From the command prompt type:
powercfg –devicequery wake_from_any
... and hit enter.

The device with the NIC you want to be listening for the WOL signal needs to be listed. If it is not, pick a different device or give up because WOL isn't going to work (not reliably any way).

If it is listed, from the command prompt type:
powercfg –devicequery wake_armed
... and hit enter.

If the device with the NIC you want to be listening for the WOL signal is properly configured, it will be listed. If it is not listed, change the configuration and check it again.

Lastly, don't forget to check that the power management settings in your bios are configured as well. You can have everything else correct, and improper bios settings can still hold you back.
For what it's worth, I use a router flashed with DD-WRT for WOL. I think most if not all DD-WRT versions can do WOL. If your router can be flashed with DD-WRT, I highly recommend it.

Good Luck!


My System SpecsSystem Spec
.
14 Jan 2015   #12
rasdaq

win 7 64
 
 

Same problem I had: WOL will not work after few minutes.

Add this: arp -s 192.168.1.xxx 01-02-03-04-05-06 in a bat file. Add the file in Task Scheduler to run on Startup or Logon, check box "Run with highest privileges".

Now is solved.
My System SpecsSystem Spec
22 Jan 2015   #13
kubajz

Mac OS X; Win XP,7
 
 

Hi,
please, my IP is static and public. My bios and network adapter based on many tutorials and threads is set properly. My network adapter is working all the time. Even though WOL works 1 min max after shut down. Based on powercfg -devicequery wake_armed command it's able to WOL also. Based on ipconfig/all command and ping my IP is static and public and is not behind any router. I've tried every bios and magic packet configuration possible. Still no luck after longer period of time.
Thank you very much
My System SpecsSystem Spec
.

02 Apr 2015   #14
MaticJ

Windows 7 Home Premium 64bit
 
 

Hi,
If your WOL works correctly but times out after a certain time all you need to do is set up static IP within the computer which will be on WOL as well as your router.

If you have not yet configured static IP within your computer -

Open Windows Start menu.
Open Control Panel.
Classic view: Open Network Connections
Category view: Select Network and Internet Connections, and then Network Connections.
Double-click on your active LAN or Internet connection.
Click Properties.
This opens the Local Area Connections Properties window.
In the General tab, highlight the Internet Protocol (TCP/IP) item, and click Properties.

This opens the Internet Protocol (TCP/IP) Properties window.
In the General tab, click Use the following IP address, and enter:
- IP address. The static IP address you want to assign to this computer. (make sure it's not xxx.xxx.x.1 as that's what your router is configured to)
- Subnet mask. Subnet mask used by your router. (255.255.255.0)
- Default gateway. IP address of your router's default gateway. (xxx.xxx.x.1)
- Make the preferred DNS to 8.8.8.8 and Alternate to 8.8.4.4
Click OK.

Then:
Click OK to close each window.
Restart your computer.


Now you need to configure your router.
Within the router look for something called DHCP, you will have to look for something like "Reserve DHCP"
Click on that and you should be able to see your computer and it's IP address, add it to the reserves (There will be different machines with reserved IP's however they will have the expiry time and date)
Don't forget to apply the settings and then save and quit


To check whether your IP is now fully static run cmd
In the cmd enter ipconfig/all
Look for something that says DHCP enabled, if it states yes then you have done something incorrectly, if it says no then everything is now set up and you should have no problems with WOL getting timeout

Hope this helps ^^



Resources - hotComm FAQ: Assign Static IP Address (Windows XP)
My System SpecsSystem Spec
21 Jun 2015   #15
colinkeenan

Windows 7 Pro x64
 
 
How to circumnavigate limited AT&T Gateway for U-Verse

I setup a Lenovo M53 for my mother in CA, but will soon be returning to my home in Kansas City. I want to keep it in good working order for her, and have uses for it myself, while at home working on my Arch Linux computer. She will be keeping it completely turned off most of the time, so I wanted to be able to turn it on at will. I got wol working just fine, but like everyone on this thread, it stopped working after a minute.

I eventually realized the fault was with the AT&T Gateway because after a minute, it saw that the Lenovo was not active, and would not forward the wol packet to it. Of course, AT&T U-verse tech support (and advanced support that you pay for if they solve the issue) was useless, since I had to teach them how wol works in the first place. They were convinced a computer could not be turned on after it was off just by receiving a packet. Anyway, AT&T U-Verse doesn't have the option to just use a modem and your own router. You have to use their gateway, and you can't even define internal static IP addresses for the devices connected to it.

Here's how I got around it (probably missing a lot of steps, but this should be enough for somebody else to figure out how to do it):
  1. I bought "BUFFALO AirStation N300 Open Source DD-WRT Wireless Router (WHR-300HP2D)"
  2. Set a switch on it to "Bridge"
  3. Unplugged my linux computer from the AT&T Gateway and plugged it into the Buffalo dd-wrt router.
  4. Connected an ethernet cable from the AT&T Gateway to the "Internet" port of the Buffalo dd-wrt router.
  5. DON'T DO THIS -> Used the web interface on the Buffalo dd-wrt router to disable wi-fi (Wireless Network Mode Disabled). TURNS OUT THE AT&T GATEWAY WIFI LOSES ABILITY TO CONNECT TO DEVICES WHEN BRIDGED DEVICE HAS WIFI OFF
  6. In the web interface, under Administration Router Management, Remote Access, I enabled HTTP remote access. (For some reason, whenever I tried to use HTTPS, I completely lost access to the web interface and had to start over after doing a hard reset.)
  7. Unplugged my linux computer from the Buffalo dd-wrt router, and plugged it back into the AT&T Gateway.
  8. Unplugged the Lenovo from the AT&T Gateway, and plugged it into the Buffalo dd-wrt router.
  9. Used whatsmyip.org from my linux computer to find the AT&T Gateway public IP address, let's call it att.pub.ip.add.
  10. In the AT&T Gateway web interface, set up a custom port forwarding that I called Buffalo HTTP to forward port 8080 to the Buffalo dd-wrt router.
  11. Accessed the Buffalo web interface through the internet at att.pub.ip.add:8080 (of course, I put in the address found from whatsmyip.org)
  12. In the Buffalo web interface, Administration WOL tab, checkmarked to enable WOL on the Lenovo that is now connected to the Buffalo dd-wrt router.
  13. Verified WOL from the web interface worked well, no matter how long the Lenovo was turned off.
  14. Really though, I wanted to issue a command from a terminal in my linux computer and have it turn on the Lenovo without using the Buffalo web interface, so had to do some more port forwarding.
  15. First, went into the web interface of the AT&T Gateway and set up a custom port to be forwarded to the Buffalo dd-wrt router; let's call it BuffPort. (Can keep a tab open to both interfaces)
  16. Back in the Buffalo web interface, under Services Management, enabled SSHd and related stuff, including the same custom port (BuffPort) that will be forwarded from the AT&T Gateway.
  17. In the Buffalo web interface, under Administration Router Management, Remote Access, I enabled SSH Management and set the custom BuffPort remote port again.
  18. Got ssh from my linux computer into the Lenovo working

    Code:
    ssh -p BuffPort root@att.pub.ip.add
  19. Figured out that the wol command didn't work in a straightforward way, but that the command that did work was stored on the Buffalo dd-wrt router, and could be printed to the screen with

    Code:
    nvram get wol_cmd
  20. Here is the command that can be ran from my Linux computer to turn on the Lenovo:

    Code:
    ssh -p BuffPort root@att.pub.ip.add '$(nvram get wol_cmd)'

The last step above is all that's related to this thread, but I also had to do some trickery to be able to ssh directly into the Lenovo from my Linux Computer because for whatever reason, I was not able to setup port forwarding using the Buffalo dd-wrt web interface. Here's how I was able to do it from the ssh terminal though:
Code:
iptables -t nat -I PREROUTING -p tcp -d $(nvram get wan_ipaddr) --dport Buff2Port -j DNAT --to 192.168.11.140:Buff2Port

iptables -I FORWARD -p tcp -d 192.168.11.140 --dport Buff2Port -j ACCEPT
Where 192.168.11.140 is the internal IP address the Buffalo dd-wrt router has for the Lenovo connected to it, and Buff2Port is another custom ssh port being forwarded to the Buffalo dd-wrt router from the AT&T Gateway. To make these port forwarding commands last after a reboot of the Buffalo dd-wrt router, I used the web interface to save them as a firewall script. It's in the Administration Commands tab. Just copy the commands in there, run them, and click the "Save Firewall" button.

A command for turning off the Lenovo from my Linux computer is as follows:

Code:
ssh -p Buff2Port Win7User@att.pub.ip.add 'shutdown /s /t 1'
Where, of course, Win7User is the username setup for ssh (using bitvise). I had to do similar stuff to get RDP working as well.

I was even able to get around the problem of att.pub.ip.add not being static by using another great feature of the Buffalo dd-wrt router: ddns. I found a completely free way to do it, but that's enough for this post.
My System SpecsSystem Spec
16 Aug 2015   #16
SysAdmHowto

Windows 10
 
 

Hi,

I just made an updated article for configuring wake-on-lan in windows 10 and windows 8.1.

Hope it will help somebody.
My System SpecsSystem Spec
Reply

 Wake-On-Lan not working after a long sleep




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Laptop extremely slow to wake up from sleep mode, 5+ minutes to wake
Hi, I am new here. Hoping someone can help me out with this issue. I work in IT so am not a complete computer bonehead and am at my wits end with this. My laptop is about 4 years old, it's a toshiba. For whatever reason, it started taking 5+ minutes to wake up from sleeping. If it sleeps...
Performance & Maintenance
Fails to wake from a scheduled sleep after a long period -
but not after a short period? Hello to all :) I have set up a windows 7 x64 machine as a file server for my htpc in the lounge. Now to save pennies i have set it to sleep at night and then wake in the mornings so its up and ready for the music and movies to be present for the htpc. Now if...
General Discussion
Wake on lan from sleep not working
My pc can wake up from sleep if it is shut down, but if it's on sleep or hibernated, i can not wake him up. I've already turned on everything in Bios and Windows. There no option like WakeOnLAN from Sleep, just WakeOnLan from PowerOff in network adapter's Advanced tab properties. I've also...
Network & Sharing
No Wake From Sleep BlockedI have an issue with the sleep function. T
I have an issue with the sleep function. The computer does not awake from sleep. When I try to do it, it behaves as if it was waking, but it never ends and there is only a black screen; the mouse and keyboard are inoperative. The only thing possible to do is a hard reboot. When it boots, it shows a...
BSOD Help and Support
Slow resume from sleep if sleep for long time
I currently run win7 ultimate 64bit, 8gig ram, intel i7-2600k cpu, and my OS runs on an OCZ SSD (all specs are in my profile) Sleep mode is set to S3 in BIOS, I have hibernation disabled (so no hibernation.sys file on my c drive) When I put my computer to sleep then immediately wake it up,...
Performance & Maintenance
Remote not working after sleep wake up
I am using Win 7 Professional x64 for my HTPC. Initially, i wasn't able to wake my PC from sleep (S3) using my IR remote (shows up as ehome transciever on device manager). I fixed that using a jumper setting on my Biostar TH55XE motherboard to change the USB power to 5VSB instead of just 5V. Now...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:21.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App