wol command

Purpose

Wakes up one or more hosts that are connected to a network in suspend mode by sending a Magic Packet.

Syntax

To send a Magic Packet to a subnet-directed broadcast address:

wol { [-m MACAddress [ [ -h Host -s SubnetMask ] | -i Interface ] | -f File } [ -v ]

To send a Magic Packet to a multicast address:

wol { -m MACAddress -M MulticastAddress [ -p Port ] [ -i Interface ] | -f File} [ -v ]

Description

The wol command wakes up one or more hosts that are connected to a network in suspend mode by sending a Magic Packet to the specified address or addresses on the specified subnet.

If the user doesn't specify either the -h, nor -s flag, the wol manager will broadcast the Magic Packet as follows:
  • If the user specifies the interface name (-i Interface), the Magic Packet will be broadcast from the specified interface.
  • If the user doesn't specify the interface name, then the wol manager will loop through each network interface installed on the machine. If an interface is up, it will broadcast the Magic Packet from that interface, and then continue to the next interface until it goes through the entire interface list on the machine.

The file specified with -f File contains the list of hosts which need to be awakened. This file consists of one or more lines, each line containing the following information in this format:

MacAddress; Hostname/IPaddress; SubnetMask; Multicast; Port; Interface

For example, the file might look like this:
00:20:35:7a:7:89a;        9.41.86.19;      255.255.255.0  ; ; ;
00:04:ac:17:c0:9f ;        obiwan.aoot.austin.ibm.com;       255.255.255. 224; ; ;
00:07:be:4a:2:394; ; ; ; ; en0
00:06:38:6b:7e:8f ;         ; ; 234.5.6.7;   12345 ;
A line starting with a "#" character is a comment and is ignored. Each line contains 6 tokens separated by ";" character. The MAC address is mandatory. The other tokens are optional, but the ";" character must be used to separate unused tokens.

Flags

Item Description
-i Interface Specifies the interface to use on the host where the wol command is being run
-f File Specifies the name of a file containing a group list. This allows the user to wake a specified group of hosts.
-h Host Specifies a host to wake, either as a hostname or as an IPv4 address in dot string representation (for example, 10.0.0.3).
-m MACAddress Specifies the a 48 bits MAC address of the host in hex representation (for example, 00:20:35:7a:78:9a).
-M MulticastAddress Specifies an IPv4 multicast address.
-p Port Specifies the port to use on the multicast machine.
-s SubnetMask Specifies an IPv4 subnet mask in dot string representation (for example, 255.255.255.0).
-v Specifies verbose mode.

Exit Status

Item Description
0 The command completed successfully.
>0 An error occurred.

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in AIX® Version 7.1 Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Location

/usr/sbin/wol