machine wakes only on local magic packet

2

I've got a Debian server, which I would like to wake up remotely using a tool like wakeonlan.

I have assigned the server a static internal IP 192.168.0.14 and set up the appropriate port forwarding in the router (which otherwise has a very limited admin interface).

When I am logged in to the same network, I can wake the server using the subnet IP, but I cannot wake the server using the public IP of the router.

What I do not understand: When the server is running and I listen on the server with netcat nc -ulv -p 9, I can see the packet coming in in both cases (both when sending to the subnet IP and when sending to the public IP of the router).

If the packet arrives in both cases, why does the machine wake up only in one of them?

leopold.talirz

Posted 2017-06-15T20:37:11.747

Reputation: 45

Answers

4

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.

Kamil Maciorowski

Posted 2017-06-15T20:37:11.747

Reputation: 38 429

thanks, I now also found this answer with some more details

– leopold.talirz – 2017-06-15T22:38:26.457

2

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

Steven

Posted 2017-06-15T20:37:11.747

Reputation: 24 804