I’ve been using Moonlight for game streaming, and one thing I’ve learned about recently is wake-on-lan: the ability to wake up your machine by sending a magic packet to a device.

I regularly use wake-on-lan on my local network to start up my gaming desktop, but I began to wonder if it’s possible to wake my machine up from the public internet (The “WAN”)? And here is how I got to successfully accomplish a wake-on-wan.

Background #

My existing setup already enables me to stream Moonlight over wan. I accomplished that by:

How wake-on-lan works #

Wake on lan works by sending an ethernet frame with the contents of the MAC address. This is often send to the broadcast IP of a network, ensuring that all devices connected to the network will receive it.

Configuring wake-on-wan #

I originally tried to do direct port forwarding of the UDP 7 through 9 ports, but I found out that my internet provider (Comcast) sometimes does not allow their modem to forward the packet.

As such, I ended up doing a separate port forward from an arbitrary port and mapped it to port 7. And that was it!

Troubleshooting #

If you have issues, try the following:

  • verify that the computer wakes if you send it the WOL request directly.
  • verify that the computer wakes if you send the broadcast IP (e.g. the request directly.