Wake-on-LAN on Linux (Local Network Only)
This guide explains how to enable Wake-on-LAN (WOL) on Linux after it has already been enabled at the hardware / firmware level.
Wake-on-LAN on Linux works only with wired Ethernet connections. It does not work reliably over Wi-Fi.
Supported systems
This guide applies to most modern Linux distributions, including:
- Ubuntu
- Debian
- Fedora
- Arch Linux
- Linux Mint
- Raspberry Pi OS
Applies only to systems using:
- Wired Ethernet
- Network cards that support Wake-on-LAN
Prerequisites
Before continuing, make sure that:
- Wake-on-LAN is enabled in BIOS / UEFI
- The computer is connected via Ethernet
- The Ethernet interface is detected by Linux
If BIOS / UEFI is not configured yet, do this first:
→ Enable Wake-on-LAN in BIOS / UEFI
No MAC address is required at this stage.
Step 1: Identify the Ethernet interface
Open Terminal and run:
ip link
Look for the active Ethernet interface.
Common names include:
eth0enp3s0enp0s25
Ignore:
lo- Wi-Fi interfaces (
wlan0,wlpXsY) - VPN or virtual interfaces
You will use this interface name in the next steps.
Step 2: Check Wake-on-LAN support
Run the following command, replacing INTERFACE with your Ethernet interface
name:
sudo ethtool INTERFACE
Look for the line:
Supports Wake-on: Wake-on:
Example:
Supports Wake-on: pumbg Wake-on: d
Meaning:
g= Wake on Magic Packet (required)d= disabled
If g is not listed under Supports Wake-on, the network card does not
support Wake-on-LAN.
Step 3: Enable Wake-on-LAN
To enable Wake-on-LAN (magic packet):
sudo ethtool -s INTERFACE wol g
Verify the change:
sudo ethtool INTERFACE
The output should show:
Wake-on: g
This enables Wake-on-LAN at the operating system level.
Step 4: Make the setting persistent (important)
On many Linux systems, Wake-on-LAN settings reset after reboot.
You must make the configuration persistent.
Option A: NetworkManager (most desktop systems)
Create or edit a dispatcher script:
sudo nano /etc/NetworkManager/dispatcher.d/99-wol
Add the following content:
#!/bin/sh
if [ "$2" = "up" ]; then /usr/sbin/ethtool -s INTERFACE wol g fi
Replace INTERFACE with your Ethernet interface name.
Make the script executable:
sudo chmod +x /etc/NetworkManager/dispatcher.d/99-wol
Option B: systemd service (generic method)
Create a systemd service:
sudo nano /etc/systemd/system/wol.service
Add:
[Unit] Description=Enable Wake-on-LAN After=network.target
[Service] Type=oneshot ExecStart=/usr/sbin/ethtool -s INTERFACE wol g
[Install] WantedBy=multi-user.target
Replace INTERFACE with your Ethernet interface name.
Enable the service:
sudo systemctl enable wol.service
Step 5: Power state considerations
Wake-on-LAN on Linux works when the system is in:
- Shutdown (S5)
- Sleep (S3)
- Hibernate (if supported)
Requirements:
- Ethernet cable must remain connected
- The system must remain powered
Step 6: Verification (optional)
After shutting down the system:
- Check Ethernet port LEDs
- They should remain on or blinking
This indicates the network interface is still powered and listening.
Common problems and solutions
Wake-on-LAN resets after reboot
- The setting is not persistent
- Use NetworkManager dispatcher or systemd service
Works from sleep but not from shutdown
- BIOS may not support WOL from S5
- Look for WOL from S5 or Shutdown Wake-On-LAN
- Disable deep sleep options in BIOS/UEFI
Interface name changes
- Modern Linux uses predictable interface names
- Verify the interface name with
ip link - Update scripts accordingly