machine wakes only on local magic packet

When your server is off, your router soon loses its entry in the ARP table. The router knows the IP to which the magic packet should go, but cannot associate MAC address. You need to define static ARP entry to make it work (although with a very limited admin interface it may be impossible).

You have defined static internal IP for the server (which "connects" IP and MAC), but this is for DHCP server, not ARP table.

Usually magic packet is a broadcast frame. When you use it in LAN, the router doesn't need an ARP entry for this specific server you want to wake up, it just broadcasts the packet. Broadcast packets are generally not routed (as Steven's answer states), that's why you send a unicast packet and define port forwarding. This packet, however, needs a valid ARP entry on your router.


A principal limitation of standard broadcast wake-on-LAN is that broadcast packets are generally not routed. This prevents the technique being used in larger networks or over the Internet. Subnet directed broadcasts (SDB) may be used to overcome this limitation.

Source: Wake-on-LAN - Wikipedia