I'd like to be able to wake-on-LAN all the computers in my home lab. Can I simply send a WOL packet to 192.168.1.255/24 and wake computers on my LAN? Thanks.
Does a WOL to broadcast IP send wake-on-LAN command to all computers on LAN
wake-on-lan
Related Solutions
Basically, when your machine is plugged in, even turned off, some maintain some very basic functions such as the network card.
They can be configured so that when a special instruction is received, it can power up the machine.
The easiest way to start is simply, if you have an integrated NIC, look in the BIOS and see if it supports it. If you have an actual Network card, you may not be able to use it... But it is worth seeing if you have a slot for a Wake On Lan Chip or cable
Also, as for saving energy, you need to obviously turn on your device! You need to have a router that can turn on devices based on a schedule or a wireless mobile or similar that you can send the instruction from - obviously though, you may just be better off turning the machine on via its power button!
Wikipedia has a good article on Wake On Lan
Wake on LAN (WoL) support is implemented on the motherboard of a computer and the network interface, and as such, is not dependent on the operating system running on the hardware, although the operating system can sometimes control the WoL behaviour. If the network interface is a plug-in card rather than being integrated into the motherboard, the card may need to be connected to the motherboard by a cable. Motherboards with an embedded Ethernet controller which supports WoL do not need a cable.
A Wake on LAN packet is usually targetted at a specific MAC. The problem with doing this remotely is that you can't target a MAC address from a non-local network.
Normally, when a packet is destined for an IP address, the router on the same network as the device being targetted will say "Who has IP address x.x.x.x", and the device that owns the address replies "It is me, send it to mac address xx:xx:xx:xx:xx:xx". This is an arp request. Once answered, the router will forward the packet to the mac address.
The problem with forwarding a packet to a machine that is off is that it cannot respond to the arp address. However, if you use the ARP binding feature of the router, you can say IP address x.x.x.x is mac address xx:xx:xx:xx:xx:xx and so the router doesn't need to do an ARP request - it already knows the mac address for the IP address, it has it in its ARP binding table.
So you need to do three things:
- Issue the PC you want to WOL a static address (this is still best done by dhcp)
- Find out the mac address of the PC and set up an ARP Binding entry with the MAC and the static IP you selected
- Set up a port forwarding rule for udp/9 to the static IP address
So the WOL packet would be targetted at the public IP address of the router, and natted to the internal address. The router would then see it has a MAC address stored in its ARP binding table, and so forward the packet to the MAC address (even though the machine is off) without attempting an ARP request.
The WOL feature will see the packet arrive on its network card, with the correct MAC and turn on the PC.
Best Answer
Yes and no.
The WoL packets as a whole are usually broadcast, in order to reach NICs which have no IP address. However, the packet data – the "magic packet" itself – needs to contain the machine's individual MAC address. So if you use the wake-on-magic-packet feature it's always directed.
The same applies to most kinds of wake-on-pattern features: while many cards allow programming a set of custom wake patterns (e.g. ARP queries, TCP SYNs), many operating systems have a hardcoded list of such patterns and they're all specific to the host as well. (Waking up the whole subnet is rarely a desired feature.)
With Linux you might be able to program the same generic WoL pattern into all hosts; however it would be much easier to just send a bunch of individual WoL packets with a simple shellscript.