wakeonlan
Wake up computers remotely over a network
TLDR
Send packets to all devices on the local network (255.255.255.255) by specifying a MAC address
Send packet to a specific device via IP address
Print the commands, but don't execute them (dry-run)
Run in quiet mode
SYNOPSIS
wakeonlan [options] <MAC_ADDRESS(es)>
or
wakeonlan -f <FILE> [options]
PARAMETERS
<MAC_ADDRESS(es)>
One or more target MAC addresses (e.g., 00:11:22:33:44:55 or 00-11-22-33-44-55). Multiple addresses can be specified on the command line.
-i <IP_ADDRESS>
Specifies the broadcast IP address to send the Magic Packet to. This is useful for waking machines across subnets (with router support).
-p <PORT>
Sets the UDP port number to send the Magic Packet on. The default and standard port for WoL is 9 (discard) or 7 (echo).
-f <FILE>
Reads MAC addresses from the specified file, one MAC address per line. Comments starting with '#' are ignored.
-b
Uses the limited broadcast address (255.255.255.255) for sending the Magic Packet.
-D
Enables debug output, providing more detailed information about the packet being sent.
-v
Enables verbose output, showing the MAC address and broadcast IP being used.
DESCRIPTION
wakeonlan is a utility used to send a special "Magic Packet" over a network to wake up a computer that is in a low-power state (e.g., suspended, hibernating, or powered off) but still connected to a power source and network. This functionality, known as Wake-on-LAN (WoL), requires support from both the network interface card (NIC) and the motherboard's BIOS/UEFI settings on the target machine.
The Magic Packet typically contains the target machine's MAC address repeated multiple times, which the NIC listens for even when the system is mostly off. Upon receiving a correctly formatted packet, the NIC can trigger a power-on event for the system. It's commonly used for remote administration, scheduled maintenance, or accessing files on a remote machine without physically being there to power it on. It operates at the data link layer (Layer 2) of the OSI model, making it independent of IP addresses for the target machine itself, though the packet delivery often relies on broadcast or directed broadcast IP addresses.
CAVEATS
- Wake-on-LAN must be enabled in the target computer's BIOS/UEFI settings and potentially in the network adapter's driver settings.
- The target computer's network card must support WoL and remain powered (often indicated by a lit link light even when off).
- Routers and firewalls might block broadcast traffic or require specific configuration (e.g., ARP binding, port forwarding) for WoL to work across subnets.
- Some network adapters may lose WoL capability after a full power cycle (unplugging the power cable).
MAGIC PACKET STRUCTURE
The Magic Packet is a broadcast frame containing 6 bytes of all FFh (FF FF FF FF FF FFh), followed by 16 repetitions of the 6-byte target MAC address. This specific pattern allows the NIC to easily detect and act upon it.
HARDWARE REQUIREMENTS
For Wake-on-LAN to function, the network card must be WoL-capable and receive auxiliary power even when the system is off. The motherboard must also support it and typically has a setting in the BIOS/UEFI (often labeled "Wake on LAN", "PCIe/PME Wakeup", or similar) that needs to be enabled.
HISTORY
Wake-on-LAN (WoL) technology was first introduced by IBM and Intel in 1997. While the underlying WoL standard has been around for decades, the wakeonlan command-line utility itself is a common implementation available on various Unix-like systems. It provides a straightforward way to send the standardized Magic Packet without needing complex network programming. Its development typically follows the broader adoption of WoL in hardware and the need for simple tools for remote system management. It's often found in distributions' repositories as a small, dedicated utility.