Originally Posted by Mike
I read the WakeOnLan guide trying to troubleshoot a problem (http://www.smallnetbuilder.com/conte.../29941/53/1/5/
), which led me here. Basically, I set up WakeOnLan on my desktop and tested it. It works fine at first, I've verified that magic packets are being received.
But then, after about 30 minutes or so, the desktop stops responding to magic packets! I know that IP addresses are lost after a certain amount of time, so I tried sending to the broadcast IP, but it still does not work. What am I missing here?
Thanks for any help,
This is caused by two different things.
First - you are partially correct in saying that ip addresses are lost after a certain amount of time - a more accurate way to put this is that the "ip address to MAC address" pairing is flushed from the arp cache.
ip addresses are not used for local (as in local
area network) communications - the ip stack compares the destination ip address to the source ip address & subnet mask to determine if the destination and the source are on the same network, and if they are it will send the data directly to the destination using it's MAC address, if they are not, it will send the data to the router (as specified in the source hosts's routing table) using the router's MAC address, for onward routing.
Now - the MAC address of the destination host is unknown to the source so it uses a protocol called arp - address resolution protocol - to get it, and it stores that in the arp cache for an unspecified period of time - arp works like this - the PC that needs the address sends a broadcast asking "who has ip address a.b.c.d?" and the PC with that address answers.
I'm sure you see the problem here - after you switch off the computer - it cannot respond to the arp request - so after the router's arp cache is flushed the router does not know where to send the magic packet, does not get a response to an arp request, and then drops the packet.
This explains why it works when the computer is first switched off but after a few moments will stop working.
The fix is to send the magic packet to the LAN's broadcast address which SHOULD cause the router to broadcast it to all hosts using the broadcast MAC address - but - as you discovered this does not work either.
Most consumer routers do not allow "ip directed broadcast" which is what is required for you to send a broadcast packet from the WAN side to the LAN side - this is a security issue and a potential attack vector that can be used to hack systems on the inside of the LAN as well as to use those systems in denial of service attacks (smurf attacks) on other targets.