Why does Wake on Lan work over WAN but not LAN?

2

1

This is an evolving question. See the 2 edits at the bottom for the latest version. I am keeping the original question here too though as it may prove useful.

Ok, So first of all sorry for yet another Wake on Lan question on the internet. I googled for many hours and was up all night last night trying to figure this out. There is definitely a lot of WOL literature out there, but I still could not figure this out.

The problem description (the problem has now changed, see edits below) is pretty simple. WOL stops working only a second or two after being shutdown. I am judging the moment of being "shutdown" as when all the LEDs shut off and the fans stop spinning on the case. It DOES work if I send the magic packet the instant it shuts down. Sometimes I can wait as long as 1 second (counting a thousand and one) and it will work. Any longer than that and it will never work again.

I have heard of issues of other people not being able to do it after a couple hours and what not. But not a few seconds.

System Details:

  • Homemade PC with Gigabyte (GA-Z68X-UD3H-B3) motherboard
  • Using the Realtek network adaptor built into motherboard
  • TP-Link WR842ND router (default firmware upgraded to latest version, looked into putting OpenWRT or DD-WRT on it, but too much work right now)
  • Dual boot system with Ubuntu and Windows 7 using GRUB2 bootloader

Things I have done:

  • I have followed this fairly official tutorial for Ubuntu.
  • Also this less official one for Windows which seemed thorough and like it might have a bit of overkill.
  • Went into my BIOS settings and enabled anything that sounded like it might help (there were a couple things that the BIOS even warned me need to be disabled if using WOL so I left those disabled)
  • I have googled for hours and tweaked things to no avail.
  • I also have completely factory reset my router and reconfigured it.

Configuration of router:

  • I am using the "address reservation" setting to make sure my realtek network adapter MAC address is always assigned the same IP.
  • I am using ARP Binding to bind my mac address/IP address
  • I am using port forwarding (virtual servers) to forward ports 9(WOL), and 22(SSH).
  • I previously just had my PC in the DMZ, but when I reset everything I did not do that and used port forwarding instead. I know the port forwarding is working at least for SSH since I was able to login to my machine via my WAN IP.

Considering the fact my machine wakes up successfully via magic packet (even though it's only possible for a brief moment) I think the configuration of my PC (BIOS/Network Adapter/OSs) is generally OK. I don't have to reset any settings after boot to make WOL work the next time. It works every time I shutdown, just for a second or two.

My test case has just been using my LAN IP for now ( so port forwarding should not be an issue at this point). I am pretty sure if I can get that working then WAN will work. So we are talking about a pretty typical use case for WOL, but it wont work.

One final piece of information, which I was not sure where else to fit in this post: The network adaptor on the PC motherboard appears to remain on after shutdown. My router shows the corresponding light activated for where my PC ethernet cable is plugged in. There are other devices on my router plugged in and shut down that do not do this. So I mean.... IT SHOULD WORK RIGHT?!

I have been going nuts over this. Please help, someone. Hopefully this is the right "StackExchange" to be posting this on, there's only a million to choose from.

IMPORTANT EDIT

IT WORKS!! Kind of.... I need to experiment more. But basically, all last night I was testing on my local network using my local IP and it was sort of working (for that brief moment). Today, while I'm still at work, I decided to just send the packet to my PC from my cell phone using the WAN (I use freedns to give me a DNS name). Lo and behold a few moments later, I am able to login via ssh. Weird right? Maybe I just left my computer on this morning (although unlikely). Sent the sudo shutdown -h now command to shutdown the computer (and not suspend or sleep I don't think). Waited actually like an hour while I had lunch. Tried to login via ssh and it timed out, sent the magic packet and a few moments later ssh works.

Now the question is, why does WOL work over WAN but not LAN?! Shouldn't that be the other way around? Just when you think you know technology it goes and does something like this.

EDIT 2

Tested. Definitely works fine when I send the packet via WAN. Does not work via LAN. I am still very confused. Might try looking for a networking expert at this point. Here's a question though. When I send via LAN, should I be sending to something other than my local IP address for the machine I want to wake up (192.168.0.100)? Or do I send it to something else? I see some people sending it to what looks like a subnet mask. Should I do that? I don't get why my local IP doesn't work though.

gnomed

Posted 2014-05-15T15:55:00.583

Reputation: 121

Do you mean shutdown or sleep? That is, are you trying to wake from standby/sleep or are you trying to do a remote boot? – Spiff – 2014-05-15T16:01:34.973

Shutdown means shutdown. Not sleep. I dont believe in any of that sleep/suspend nonsense. I like a clean memory slate when I boot my PC. – gnomed – 2014-05-15T16:03:20.127

1Okay, I think you might be conflating WOL with lights-out management (out of band management). WOL has traditionally been about waking a machine from sleep (standby), not about getting a fully shut down machine to power on. Does WOL work to wake your machine from sleep? – Spiff – 2014-05-15T16:21:34.187

That might be worth testing and would probably help me narrow down my issue (I'm at work right now, so I will test later). Your question made me do some reading. Wikipedia has a pretty good blurb that says it could be possible to boot using WOL only from shutdown state and not from sleep state or vice versa. http://en.wikipedia.org/wiki/Wake-on-LAN#Troubleshooting_magic_packets

– gnomed – 2014-05-15T16:36:20.650

@Spiff New update. See edit above.... Extremely weird behaviour. – gnomed – 2014-05-15T19:34:17.463

Answers

1

I took a quick glance at your motherboard manual, waking up is only mentioned in relation to an ACPI S3 state. This suggest to me, that this is the only mode it will wake from.

http://download.gigabyte.us/FileList/Manual/mb_manual_ga-z68x-ud3h-b3_e.pdf

Enables the system to enter the ACPI S3 (Suspend to RAM) sleep state (default). In S3 sleep state, the system appears to be off and consumes less power than in the S1 state. When signaled by a wake-up device or event, the system resumes to its working state exactly where it was left off.

Zoredache

Posted 2014-05-15T15:55:00.583

Reputation: 18 453

Oh, and I am running a 'GA-Z87X-UD5H' at home. I spent some time researching this related to that. As far as I have been able to find, you can only wake from S3. – Zoredache – 2014-05-15T16:56:51.243

Looks like that is it. Reading on from that section a couple of the wake settings specify only waking "from an ACPI sleep state" :(:( That is super lame. I wonder if this is hardware or BIOS limited and if I could pester Gigabyte for a BIOS fix (probably not, but I'll at least email them and make sure we're not missing anything). That at least settles my confusion, although I am now very sad. But thanks much. PS: I'll accept your answer soon, I am just reluctant to give up :( maybe once I hear back from Gigabyte. – gnomed – 2014-05-15T17:01:31.867

New update. See edit above.... Extremely weird behaviour. – gnomed – 2014-05-15T19:33:27.527

Got some frustratingly difficult to understand responses from Gigabyte (language barrier by the looks of it), but they said it should be supported from a "soft power off" (which I assume means the standard shutdown process). And it clearly is anyway since I got that part working. – gnomed – 2014-05-16T18:51:24.947