1

Can i use Wake on Lan on a web server that is a sleep but when the public wants to view my web site it wakes the server up?

As this is what i thought it was and was getting very excited but all i can find on the net is waking up a sleeping computer with your internet device. ie phone

  • Well thanks everyone for the response. a disappointing answer but the truth hurts some times, will just have to concentrate on a low powered NAS system instead then. i just assumed that when people typed in my web address as i have the address pointing to my router that the router would send the WOL packet to my NAS server :( o'well :) – WhiteFinger Dec 14 '11 at 12:17

4 Answers4

3

Unfortunately, I don't think there's an easy way to do what you want. Wake-on-LAN (or WOMP) requires a specially formatted packet; by design, it's hard to wake a computer "by accident."

Even if you could convince a web browser to include the magic string (which includes your server's MAC address) in the request, it wouldn't work, because the server would need to be woken up by the first packet in the connection (TCP SYN), which doesn't contain data. (And even if you did manage to coax a web browser into including the magic string early enough in the request that it would fit in the first packet, and convinced its OS to include that data in the SYN, it still wouldn't work for at least the first request, because the server's OS would never see that first packet.)

Probably the easiest hard way would be to set up some device between your server and the internet (like a small wireless router) with a HTTP proxy to your real server, and somehow set things up such that whenever a request comes in to the proxy and the real machine isn't awake, it sends the magic packet.

jon
  • 890
  • 5
  • 15
  • 1
    I can certainly see making something that could wake a system based on a request, but it would almost certainly be far to slow. – Zoredache Dec 14 '11 at 01:05
  • @Zoredache: using STR and not full power off could be fast enough, If the server gets one or two hits a week. But then, virtualizing it would be a better idea. It's useful in only *very* specific workloads. – Hubert Kario Jan 16 '12 at 10:18
1

No, that's not how it works. You could design such a thing, but you'd need a web server that was always one to send the wake-on-LAN packets to your machine.

David Schwartz
  • 31,215
  • 2
  • 53
  • 82
1

Welcome to serverfault!

Wake-on-Lan functions by sending a "magic-packet" to the destination mac. This is almost always done on the same subnet as the device/server you're trying to wake up. You can use subnet directed broadcasts on an internal network to overcome this but this option won't be supported over the internet.

The reason you're having trouble is that to do this over the internet, you need to be able to forward a port to a broadcast IP in your perimeter firewall. Typically, port forwarding is configured for a specific destination IP. In this case, you can't do that because the box won't be up so the typical method of figuring out where to send the packet given an IP (ARP) isn't going to work.

Don't fear, you should be able to accomplish this by googl'ing port forwarding for Wake-on-lan with your specific firewall's model, etc. Once you have forwarded a port to the entire subnet (yes I suppose that could be a security risk), then, pop in your public IP, mac of the server, port and fire away.



Of course, the general public wouldn't be able to do this unless you had a basic site on another server that was available that could send the packet for you.

Paul Ackerman
  • 2,729
  • 15
  • 23
1

In theory, anybody can send a WOL packet. Most users don't know how. How do you suppose they'll get instructions to do it if your server is off? Particularly knowing your MAC address?

If they know that, they can direct the packet to the right subnet and unless a firewall steps in, it would work.

Jeff Ferland
  • 20,239
  • 2
  • 61
  • 85
  • 1
    It also needs to be a broadcast on the Ethernet level, so it still won't work (unless the host which first routes the packet onto his server's segment supports directed broadcast and the client knows how to do that.) – jon Dec 14 '11 at 02:29