Linux Wake-on-LAN
Linux PCs can support wake on sleep, hibernate or shut down. Support varies with hardware and is usually disabled by default.
Enable WoL in PC Firmware (UEFI or BIOS)
This process varies, see manufacturer documentation for details.
- Boot the PC and enter the UEFI or BIOS menu by following the on screen instructions. Usually it is a special button press during boot, such as
del
oresc
. - Look for a wake, resume or power on by PCI or PCI-E option. This is Wake-on-LAN, enable it.
- Save and reboot.
Disable Fast Boot
The Windows Fast Boot or Fast Boot option, allows Windows to enter Hybrid Shutdown. This option can interfere with wake from hibernate and shut down, wake from sleep is not impacted. You may want to disable it.
Disable Energy using Product
The EuP, EuP 2013 or Energy using Product option, allows some motherboards shut off the network adapter to save power while in sleep, hibernate or shut down. You may need to disable it.
Find network interface name and MAC Address in Linux
- On your Linux PC, open a terminal.
- Run
ip a
to list network interfaces. - Look for the entry with
state UP
, this is the active network interface. - The interface name follows the network interface entry number.
- The MAC address follows
link/ether
.
In the following example, the network interface name is enp3s0
and the MAC Address is 44:8a:5b:5e:ff:ff
.
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 44:8a:5b:5e:ff:ff brd ff:ff:ff:ff:ff:ff
Check Wake-on-LAN status with ethtool
- On your Linux PC, open a terminal.
- Run
sudo ethtool interface
replacinginterface
with your interface name. - Look for
Wake-on: g
, this indicates that Wake-on-LAN is enabled.
Enable Wake-on-LAN with ethtool
- From within a terminal.
- Run
sudo ethtool --change interface wol g
replacinginterface
with your interface name. - Check Wake-on-LAN status
Wake-on-LAN setting is not saved on reboot
Many Linux distros, such as Ubuntu and RedHat, do not save the Wake-on-LAN setting on reboot. Refer to your distro documentation for details.
On Ubuntu, I use system.d
to enable Wake-on-LAN on boot.
Enable Wake-on-LAN on boot with system.d
Example /etc/systemd/system/wol.service
. Replace enp3s0
with your network adapter name.
[Unit]
Description=Activate Wake-on-LAN
After=network-online.target
[Service]
Type=oneshot
ExecStart=/sbin/ethtool -s enp3s0 wol g
[Install]
WantedBy=basic.target
Enable the service with systemctl
.
sudo systemctl enable wol.service
With this setup, Wake-on-LAN is enabled with the network adapter. It is possible to put the computer to sleep prior to the network adapter coming online and Wake-on-LAN being enabled. For example, a quick power down or sleep, will cause a temporary Wake-on-LAN failure.