|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Wake On LANVia Wake On LAN, from now on called WOL, it is possible to power on or wake up a computer. This is mostly used for administrative purposes. To wake up the computer a so called "Magic Packet" must be sent to the network interface. A computer that is powered off can't use the ip protocol but the network interface is usually supplied with current (at least in the ATX specification which apply to most of the currently sold personal computers) so the card can read the traffic reaching it. It is sufficient if the "Magic Packet" is somewhere in a frame reaching the network interface. The content of the "Magic Packet" must be like this:
In an environment with switched ethernet the destination address of the ethernet frame must have a broadcast address (this means ff:ff:ff:ff:ff:ff). The content of the "Magic Packet" is wrapped inside a UDP packet. UDP because it is connectionless. A broadcast address is choosen for the ip destination. This is usually 255.255.255.255. Such a broadcast will not be routed and therefore the packet must be sent from a box inside the same network segment the computer that is to be woken up is in. The sending box can have multiple interfaces (for example it could be a router) and so the right interface must be picked. From this interface the ethernet source address and the ip source address are taken. The complete UDP paket could look like this example:
Because none of my experiments to generate a Magic Packet with existing software was successful I decided to write a program managing this task. This program is now fit to my requirements. I called it wakeup. It uses libnet for a simple way of creating network packages. The source should be compileable and installable via make. If it is not working I would like to see a short description of the problem so that I can fix it. What is the relation to OpenBSD? Well, most already available solutions I found were Linux centered programs. The ports tree from OpenBSD includes a perl module that should generate such a Magic Packet. But I could not get it to work with my system. wakeup is only tested on my OpenBSD system. Reports about other working operating systems or bug reports are welcome... Using the newer libnet-1.1I did a rewrite of the original wakeup which depended on libnet-1.0 for the newer libnet-1.1. The source of version 0.2 should compile on unix like systems, a port for OpenBSD can be found here. New wake command in -current
|