| WAKEONLAN(1) | User Contributed Perl Documentation | WAKEONLAN(1) |
NAME
wakeonlan - Perl script to wake up computers
SYNOPSIS
wakeonlan [-h|--help] [-v|--version] [-q|--quiet] [-n|--dry-run] [-i|--ip IP_address] [-p|--port port] [-f|--file file_name] [-d|--delay seconds] [[hardware_address] ...]
DESCRIPTION
This script sends 'magic packets' to wake-on-lan enabled ethernet adapters and motherboards, in order to switch on the called PC. Be sure to connect the NIC with the motherboard if necessary, and to enable the WOL function in the BIOS.
The 'magic packet' consists of 6 times 0xFF followed by 16 times the hardware address of the NIC. This sequence can be encapsulated in any kind of packet. This script uses UDP packets.
OPTIONS
- -h, --help
- Displays the full POD documentation, which includes usage examples.
- -v, --version
- Displays the script version.
- -i, --ip=IP_address
- Destination IP address. Unless you have static ARP tables you should use some kind of broadcast address (the broadcast address of the network where the computer resides or the limited broadcast address). Default: 255.255.255.255 (the limited broadcast address).
- -p, --port=port
- Destination port. Default: 9 (the discard port).
- -f, --file=file_name
- File with hardware addresses of wakeable computers. For an example check the file lab001.wol in the examples subdirectory.
- -q, --quiet
- Quiet mode.
- -n, --dry-run
- Print the commands that would be executed, but do not execute them.
- -d, --delay=seconds
- Delay (in seconds) between sending magic packets. Can be a fractional second (e.g., 0.5).
EXIT STATUS
- 0
- Success. Either the queued magic packets were all sent, or the requested help or version information was displayed.
- 1
- Invalid command line options.
- 2
- Invalid default destination port (see -p, --port).
- 3
- Invalid default destination IP address (see -i, --ip).
- 4
- The file given to -f, --file is missing or is not a plain file or a FIFO (named pipe).
Invalid records -- hardware addresses, IP addresses or ports that fail validation -- are reported on the standard error and skipped, and on their own do not change the exit status: a run in which every record is rejected still exits with 0.
Any other non-zero exit status denotes an unexpected runtime failure, such as a file that cannot be opened or a socket that cannot be created. Those failures come with a message on the standard error and the status is the underlying system error number.
EXAMPLES
Using the limited broadcast address (255.255.255.255):
$ wakeonlan 01:02:03:04:05:06 $ wakeonlan 01:02:03:04:05:06 01:02:03:04:05:07
Using a subnet broadcast address:
$ wakeonlan -i 192.168.1.255 01:02:03:04:05:06
Using another destination port:
$ wakeonlan -i 192.168.1.255 -p 1234 01:02:03:04:05:06
Using a file as source of hardware and IP addresses:
$ wakeonlan -f examples/lab001.wol $ wakeonlan -f examples/lab001.wol 01:02:03:04:05:06
AUTHOR
José Pedro Oliveira <jose.p.oliveira.oss@gmail.com> maintaining and expanding original work done by Ico Doornekamp <ico@edd.dhs.org>.
COPYRIGHT
Copyright (c) 2000-2026 José Pedro Oliveira.
This is free software. You may modify it and distribute it under the Perl's Artistic License 2.0. Modified versions must be clearly indicated.
SEE ALSO
For more information regarding this script and Wakeonlan technology just check the project page at https://github.com/jpoliv/wakeonlan.
| 2026-08-10 | perl v5.42.2 |