That's why it's called "Wake-on-LAN". It's supposed to work in LANs.
However, I've been told more than once that, to my surprise, any packet received by the computer's NIC may be a magic packet if it
- is addressed to the broadcast MAC address, and
- contains anywhere in the payload the magic string (6x
FF and 16x
computer's MAC address)
However, your router needs to allow the forwarding of packets to the broadcast MAC address, or your computer's WoL system needs to be more flexible, such as accepting WoL addressed to its own MAC address (I actually thought this was the standard approach, but Wikipedia says I'm wrong).
Since it looks like Internet WoL is unreliable, as you will depend on intermediate routers allowing it, you are probably safer if you find something in your network you may use to do the WoL for you. For example, being able to
telnet, but that's dangerous) to your router and send the magic packet from there. Or, if your router is supported, check out dd-wrt and flash your router if you're comfortable with it.
dd-wrt can be used to send the magic packet from within your network, and since it is always on, you won't need more hardware online 24/7.
I use a Raspberry Pi as a WoL "platform" - the router has a port forward to the Pi's
ssh server, so I
ssh to the Raspberry Pi and send the magic packet from there. Since it is inside the LAN, it's close to guaranteed that the WoL will work.