Skip to content

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.

  1. 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 or esc.
  2. Look for a wake, resume or power on by PCI or PCI-E option. This is Wake-on-LAN, enable it.
  3. 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

  1. On your Linux PC, open a terminal.
  2. Run ip a to list network interfaces.
  3. Look for the entry with state UP, this is the active network interface.
  4. The interface name follows the network interface entry number.
  5. 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.

```(bash) 2: enp3s0: 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

1. On your Linux PC, open a terminal.
2. Run `sudo ethtool interface` replacing `interface` with your interface name.
3. Look for `Wake-on: g`, this indicates that Wake-on-LAN is enabled.

## Enable Wake-on-LAN with ethtool

1. From within a terminal.
2. Run `sudo ethtool --change interface wol g` replacing `interface` with your interface name.
3. Check Wake-on-LAN status

!!! note "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.
```(bash)
[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. (bash) 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.

Nvidia driver hang on sleep/hibernate

The Nvidia binary driver requires sleep/hibernate configuration. See Nvidia's documentation for details.