Frequentely Asked Questions

Why is this site free ? Why no ad ? Why no donation ?

Why free?
In my Internet life, I was happy to find so much information on free web sites and so many very usefull open sources applications. In return, as long as I can afford to provide a usefull service I am glad to offer it at no cost. Plus, if used, Wake on Lan will save energy which is better for our sole planet.

Why no ad?
It's an unbearable visual pollution and an unacceptable network resources waste.

Why no donation?
Simple, from my experience, it is not worth the trouble to setup.

How can you help?

Thank you for your help.

All suggestions and comments are welcome. Do not hesitate to contact me.

Phil Ten
<phil @ philten . com>
http://www.philten.com

What is Wake On Lan and how it works ?

Wake on LAN, or WOL, is the ability to send a signal over a local area network (LAN) to wake up a PC. For example, you may have a powered off PC at home. Yet, while at work you may want to access it. Using Wake on LAN you will be able to power up the PC.

Remember, the PC is powered off, therefore no operating system is running and no IP adress assigned. Luckily, the MAC (Media Access Control) address being hardcoded in the network adpator remain usable to identify a PC in all states.

Using this MAC address another PC on the network may send to the sleeping PC a wake-up signal. Up to the network to relay this signal. Up to the destination PC to take or not into consideration this signal.

The wake up signal is a specific data frame, called “magic packet”, containing the Ethernet address of the remote network card. The magic packet is sent to all devices on the network (UDP broadcast) but is catched only by the device owning the matching MAC Address.

MAC Addresses are not routable, in other words it is not possible to send network datas over the Internet using a MAC Address as the destination. Therefore, to send a magic packet over the Internet it must be embedded in an UDP packet sent to the IP address of the LAN gateway/router. Up to the router to extract the magic packet from the UDP packet and then broadcast it on it's LAN leg. Unfortunately not all routers will support this feature.

External Wake on Lan tutorials

Wake on LAN is usually disabled by default an may be tricky to enable. I strongly recommend using one of the following tutorials.

Wake-up frame (magic packet)

A Wake-up frame is a special data packet containing the Ethernet address of the remote network card. Somewhere in this frame should exist a byte stream (magic sequence) composed by, at the least, 16 times the repetition of the Ethernet address and preceded by a synchronization stream of 6 bytes of FFh.

If the MAC address of a target computer is 01:02:03:04:05:06 (6 bytes), the according magic packet would be:

    FFFFFFFFFFFF010203040506010203040506010203040506010203040506
    010203040506010203040506010203040506010203040506010203040506
    010203040506010203040506010203040506010203040506010203040506
    010203040506010203040506  

How can I confirm if a PC supports Wake On Lan ?

First, search for related options in its BIOS settings. If found, Wake on LAN is supported. If not found Wake on LAN may or may not be supported. A fairly reliable hint is to check if the network connector is seen as active by the swicth (green or orange LED for the according port). You may also check the LED status on the computer beside the network cable connector. If active Wake on LAN is very probably supported.

Magic packet sniffer ?

If your PC do not wake up as expected, the first troubleshooting step is to verify if the magic packet does reach the PC. To proceed, you may use one the the following software tool:

http://www.depicus.com/wake-on-lan/wake-on-lan-monitor.aspx

This tool monitor magic packet embedded in UDP packet. Make sure to specify the correct port on which you expect magic packets to arrive.

Does Wake On Lan work with wireless networks ?

No. Only wired networks. Additional information carried in wireless frames interferes with the magic packet and prevent the destination PC from detecting the wake up signal.

Is a static public IP address required to use Wake on Lan?

No. But you need to know the current public IP address of your LAN gateway when you wish to wake up a PC. The easiest is to use a Dynamic DNS service (www.dyndns.org). Most router will support it.

Wake On Lan with a Freebox (France)

If your Internet Access Provider is Free (in France) you are lucky. Your freebox support natively Wake on Lan. However, it is disabled by default. To enable Wake on Lan:

Important!
The freebox expect to receive magic packets embedded in UDP packet incoming on port 9. When a compliant network packet is received from the Internet, the freebox will forward the magic packet to target computer. If you try to view the magic packet with "Depipucs Wake on Lan Monitor/Sniffer" make sure to specify port 9.

Wake On Lan with a Livebox (France)

At this time (2009/08), liveboxes Sagem and Inventel do not support wake on LAN, neither natively, nor via an UDP broadcast forward. In other words, as far as I know, it is impossible to send a magic packet over the Internet throuth a livebox gateway. The only known workaround is to use a third device located on the same LAN able to forward an UDP broadcast packet.

What router models support Wake On Lan (Standalone or via UDP forward to a broadcast address) ?

Unfortunately, information about this specific feature is often difficult to find. Usually, it won't appear in technical datasheets and, even worst, it may change from one firmware version to another. In short, most router do not support UDP forward to a broadcast address.

If you decide to purchase a new router to support Wake on LAN, I recommand to choose a model supporting Linux open sources firmwares.

DD-WRT firmware and Tomato firmware both have a very good standalone Wake on Lan or Wake on Wan support. By standalone, I mean that you connect to the router using a web browser and access a dedicated page allowing to wake up any devices on the LAN. For WOL purpose, it is not required to install a DD-WRT or Tomato box as a router. If you simply connect the box to the LAN via one of it's LAN port, you will be able to use it's Wake on LAN features.

Tomato WOL DD-WRT WOL
Tomato v1.25 WOL Feature
DD-WRT v24sp2 WOL Feature

These combinations would work great for STANDALONE wake on lan:

Now, to wake up a device via an UDP magic packet sent by wolcenter.com the router must be able to UDP forward to a broadcast address. Two cases must be taken into consideration:

In this case, the UDP packet arrive on the WAN port and is forwarded to the LAN. By default, latest Tomato (v1.25) and DD-WRT (24SP2) do not support UDP forward to a broadcast address.

The good news is that an easy workaround can be implement on both firmware. Simply add the two lines below to the init script:

ip neigh change 192.168.1.254 lladdr ff:ff:ff:ff:ff:ff nud permanent dev br0
ip neigh add 192.168.1.254 lladdr ff:ff:ff:ff:ff:ff nud permanent dev br0

Make sure to replace the IP address "192.168.1.254" by a free IP member of your LAN subnet. Then, create a UDP forward rule toward 192.168.1.254. Since ff:ff:ff:ff:ff:ff is a broadcast address, the UDP packet will be sent to all device on the connected to the LAN.

Note that if you try the first line of the script in a console, it will return an error:

first command return an error "RTNETLINK answers: No such file or directory"

but, despite the error message, it does work.

To check the current status, in a console session type:

# ip neigh show
192.168.1.254 dev br0 lladdr ff:ff:ff:ff:ff:ff PERMANENT         

Init scripts settings are located at:
for DD-WRT: Administration >> commands >> startup
for Tomato: Administration >> scripts >>Firewall

In this case, we would like the router to act as a UDP proxy. More specifically, it should be able to broadcast an UDP packet received on a LAN port.

By default, DD-WRT (24SP2) and Tomato (1.25) won't support this feature, but it can be implemented as small executable called "UDP-Proxy":
- UDP-Proxy v.0.50 build for Tomato v1.25
- UDP-Proxy v.0.50 build for DD-WRT v24SP2
- UDP-Proxy v.0.50 source code

To survive a reboot, UDP-Proxy must be copied into the /jffs diretory.

To start automatically add the following launch command to the init script of the router:

/jffs/udp-proxy 7 192.168.1.255 8 &

where parameter 1 is the input port, parameter 2 is the destination broadcast address, parameter 3 the destination port.

For Wake on Wan driven by wolcenter.com:

My router does not natively support Wake On Lan, what can I do?

By "natively", I mean that the router will forward to the LAN all magic packets received from the Internet. If a router don't support Wake on LAN natively a few workaround may be usable:

If none of the suggestion above work for you, the last solution is to use a third hardware device (router or PC always powered on) which will operate the UDP forward to broadcast address.

What is a broadcast address?

When a data frame is sent at a broadcast address, it is received by all devices connected to the network (assuming broadcast addresses are allowed on the LAN). In most home and small business it will end in .255. For example, a gateway router with an IP address of 192.168.1.1 will typically have a broadcast address of 192.168.1.255.

I mention that if the subnet mask is 255.255.255.128, the UDP broadcast address is 192.168.1.127.

For Wake on LAN, sending a magic packet to a broadcast address is very convenient because all devices connected to the LAN will receive the magic packet. However, since the magic packet contain the target MAC address, only the destination PC (according to the MAC address) will take into consideration the wake up request. All other PCs will ignore the network packet. Remember that since the PC is powered off, it has no assigned IP address usable to submit a network message.

How to UDP forward to a broadcast address?

All routers include a "port forwarding" feature, it allows to forward all incoming (from the Internet) UDP packets (on a specific port) to an internal IP address and port. To forward to the broadcast address of your LAN, simply define a port forwarding rule to the broadcast adress of your LAN (ex: 192.168.1.255). The exact procedure depend on your router brand and model and will be described in the manual.

Unfortunately, many router models won't allow forward to the broadcast address. Furthermore a specific model may support it with a firmware version, and deny it with another firmware version.

While trying to set a destination as a broadcast address, some routers may refuse the save the forward rule, some others will accept to save the rule but won't execute it.

Two workarounds may be tried:

A last option, is to replace your router with a model supporting UDP forward to a broadcast address, most likely running an open source firmware Tomato or DD-WRT.

Workaround with a second device to operate a UDP forward to a broadcast address?

If your gateway router does not support UDP forward to a broadcast address, you may use a second device, always powered on, which does support the needed feature. This second device may be a Windows or Linux PC, a router with an open source firmware, or a NAS running a Linux OS with a console access (Synology, Qnap, DLink,...)

This workaround do not consist in chaining two routers across two subnets. No routing is executed by the added device. It simply listen for UDP packets on a predefined port and UDP broadcast them over the LAN.

In other words, no need to change network configurations of all your existing devices connected to the LAN.

Very probably, the device added won't support UDP forward to a broadcast address by default. Luckily, in many cases it's quite simple to implement the feature. A page dedicated to this setup is available here.

Workaround with a second router to operate a UDP forward to a broadcast address?

Some Internet Access Provider provide an ADSL router (ex: triple play box) which cannot be replaced by a different model. In this case, it's possible to add a new device to operate the UDP broadcast as suggested above. Another solution consist in chaining a router (with UDP broadcast support) to the IAP box. If the box can be used in a bridge mode it's easier because you still have only one subnet. If the box can't be connected as a bridge you must define two private subnets. Both cases are a little tricky to setup, and since I can't see any advantages when compared to the workaround with a standalone device to operate UDP broadcast I won't describe further this approach.

Why can't I simply forward the magic packet to the IP address of the PC to wake up?

Well, actually you can, but only for a few minutes after the PC shutdown. Indeed, after this delay, the router will loose the mapping between the MAC address and IP address and will be unable to find the target, and therefore unable to forward the magic packet.

How can I remotely shutdown a computer?

As far as I known, the only solution to power off a PC is via the operating system using a user session (SSH, Remote Desktop, VNC ...)

Within a Windows Remote Desktop Session, you may power off the computer with the following command in a console window:

tsshutdn /POWERDOWN

What is Wake On Wan?

“Wake on WAN” is the ability to send a magic packet over a wide area network (WAN), such as the Internet, to wake-up a PC on a private LAN.

Sometime the PC does not wake up, why ?

The symptom: the complete chain is configured correctly and your PC does wake as expected when a magic packet is sent. However, from time to time it does not work. The PC does not wake up.

It seem that some network board need to be programmed in a specific state to wake up the PC on reception of a magic packet. This is executed while the PC is running (under linux, command "ethtool -s eth0 wol g"). In case of a power loss the network board will be reset and therefore no longer listenning for wake on lan requests. In other words, after a power loss (while the PC is shutdown) wake on lan may not work.

To make sure the PC will remain wol bootable even in case of a power loss, I suggest to configure the bios to "Power On" in case of a power loss, with a task at boot time to send a startup notification by email. This way you are informed that the PC started and you can manually shut it down. After a proper shutdown the PC will remain in a wol bootable state.

Freeware to send a Magic Packet

PHP function to send a magic packet over the Internet

<?php

# Wake on LAN - (c) HotKey@spr.at, upgraded by Murzik
# Modified by Allan Barizo http://www.hackernotcracker.com
flush();
function WakeOnLan($addr, $mac,$socket_number) {

$addr_byte = explode(':', $mac);
$hw_addr = '';
for ($a=0; $a <6; $a++) $hw_addr .= chr(hexdec($addr_byte[$a]));
$msg = chr(255).chr(255).chr(255).chr(255).chr(255).chr(255);
for ($a = 1; $a <= 16; $a++) $msg .= $hw_addr;
// send it to the broadcast address using UDP
// SQL_BROADCAST option isn't help!!
$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
if ($s == false) {
echo "Error creating socket!\n";
echo "Error code is '".socket_last_error($s)."' - " . socket_strerror(socket_last_error($s));
return FALSE;
}
else {
// setting a broadcast option to socket:
$opt_ret = socket_set_option($s, 1, 6, TRUE);
if($opt_ret <0) {
echo "setsockopt() failed, error: " . strerror($opt_ret) . "\n";
return FALSE;
}
if(socket_sendto($s, $msg, strlen($msg), 0, $addr, $socket_number)) {
echo "Magic Packet sent successfully!";
socket_close($s);
return TRUE;
}
else {
echo "Magic packet failed!";
return FALSE;
}
}
}

// Port number where the computer is listening. Usually, any number between 1-50000 will do. Normally people choose 7 or 9.
$socket_number = "9";
// MAC Address of the listening computer's network device
$mac_addy = "00:01:02:03:04:05";
// IP address of the listening computer. Input the domain name if you are using a hostname (like when under Dynamic DNS/IP)
$ip_addy = gethostbyname("my.computer.com");
WakeOnLan($ip_addy, $mac_addy,$socket_number)

?>