Wake-on-LAN (WoL) is a feature to switch on a computer via the network.
This details how to enable WoL on our system.
- Turn on your Server from anywhere!
- [Motherboard]How to set and enable WOL(Wake On Lan) function in BIOS
-
Check if your motherboard supports WoL and how to enable it.
-
In general, head to the motherboard's BIOS and enable WoL:
-
Click the Advanced tab.
-
Select APM Configuration.
-
Under Power On By PCIE, select Enabled.
-
Press the F10 key to save and exit the BIOS.
[!NOTE]
In some cases, you may need to also disable ERP if it was enabled by default by the motherboard. -
-
Get the name of your network interface and its MAC address:
ip addr show
This will return several results/interfaces on our system, including virtual ones. We are interested in the physical interface which connects us to the network.
In most cases, it is the second interface returned. For example:
2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 80:eg:f9:5f:06:28 brd ff:ff:ff:ff:ff:ff inet 192.168.0.125/24 brd 192.168.0.255 scope global noprefixroute enp7s0 valid_lft forever preferred_lft forever
From this example, the interface name is
enp7s0
, and the MAC address is80:eg:f9:5f:06:28
. -
Use
ethtool
to check if WoL is supported/enabled:sudo ethtool enp7s0 | grep "Wake-on"
Sample output:
Supports Wake-on: pumbg Wake-on: g
The
g
in the output of Supports Wake-on indicates that WoL is supported, and theg
in the output of Wake-on indicates that WoL is enabled. -
If WoL is not enabled, enable it on said interface (i.e.
enp7s0
):ethtool -s enp7s0 wol g
To make it persistent, either create a
wol@
systemd
service or install thewol-systemd
package on Arch Linux based systems.Create a
[email protected]
systemd
service:sudo nano /etc/systemd/system/[email protected]
Copy the content of the sample [email protected] file, paste it into the service file you created, and save it.
Alternatively, install the
wol-systemd
package from theAUR
usingyay
.Lastly in either options, start and enable the
wol@
systemd
service for the network interface. Assuming the network interface isenp7s0
, the service name would be[email protected]
.
This details how to trigger WoL on a system from another system.
Important
This only works if the target system is connected to the same network (via Ethernet) as the system you are triggering the WoL from.
-
Install the
wakeonlan
package usingyay
.It is also available on
homebrew
for macOS:brew install wakeonlan
-
Run the
wakeonlan
command with the MAC address of the target system that you wish to wake (i.e.80:eg:f9:5f:06:28
):wakeonlan 80:eg:f9:5f:06:28