Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Linux / How to Enable Wake-on-LAN (WOL) in Linux

February 13, 2024

How to Enable Wake-on-LAN (WOL) in Linux

The Wake-on-LAN (WoL) feature allows you to remotely wake up a Linux computer by sending a special broadcast Ethernet packet (magic packet) containing the MAC address of the host you want to turn on.

Before enabling WoL on Linux, you need to make sure that your motherboard supports this feature and enable it in the BIOS setting. Restart the host and open the BIOS (UEFI) settings. The name of the WoL option may differ depending on the vendor, motherboard model, and firmware version. This option can be called Wake on PCI/PCI-E, Power or Resume on PCI/PCI-E, S5 Wake on LAN. Find and enable this option. Save the BIOS settings.

The ethtool tool is commonly used to manage Wake On LAN in Linux. Install it:

$ sudo apt install ethtool

List network interfaces:

$ ifconfig

Copy the interface name of your Ethernet LAN adapter and run the command:

$ sudo ethtool enp3s0 | grep "Wake-on"

ethtool - enable Wake-on-LAN on LInux ethernet interface

In this case, WoL is disabled (d).

Enable Wake on LAN for the specific adapter:

$ sudo ethtool --change enp3s0 wol g

The Wake On Lan option should change to g (Wake on MagicPacket).

The ‘netlink error: cannot enable unsupported WoL mode (offset 36)‘ indicates that WoL is not supported by the network adapter or is disabled in the BIOS.

netlink error: cannot enable unsupported WoL mode (offset 36)

You can now remotely wake up your Linux host. However, the network interface’s WoL option will be reset on reboot. There are several ways to automatically enable Wake on LAN for the adapter when the computer boots.

NetworkManager is the default network management tool in many Linux distros including Ubuntu, Rocky, and Debian. In NetworkManager, you can enable WoL for an adapter using the nmcli command:

$ nmcli con show

Copy the name of the Ethernet connection (wired in this example) and enable WoL:

$ sudo nmcli c modify "wired" 802-3-ethernet.wake-on-lan magic

Check that Wake on LAN is enabled on the interface:

$ nmcli c show "wired" | grep 802-3-eth

NetworkManager: enable wake-on-lan magic using nmcli

For other Linux distributions, you can use systemd to enable WakeOnLan on boot. Create a new systemd unit:

$ sudo systemctl edit wol.service --full --force

Add the following configuration:

[Unit]
Description=Enable Wake-on-LAN
After=network-online.target
[Service]
Type=oneshot
ExecStart=/sbin/ethtool --change enp3s0 wol g
[Install]
WantedBy=network-online.target

systemd service to enable Wake on LAN

Enable the service:

$ sudo systemctl daemon-reload
$ sudo systemctl enable wol.service
$ sudo systemctl start wol.service

Check that the service is running:

$ systemctl status wol

You can now test how Wake on Lan works on this host. Copy the MAC address of the network adapter on which you have enabled WoL.

ifconfig get MAC

Check that sleep mode is enabled on Linux:

$ sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target

Put your Linux host to sleep:

$ sudo systemctl suspend

To send a magic packet on Linux, you can use wakeonlan or etherwake tool:

$ sudo apt-get install wakeonlan etherwake

To remotely wake a computer, enter its MAC address (WoL packets are not routed, so computers must be on the same LAN segment):

$ wakeonlan <MAC-address>
or:
$ etherwake <MAC-address>

After receiving the magic packet, the computer should wake up. Note that WoL doesn’t require opening the port in the Linux firewall. The WoL UDP broadcast packet is received and processed directly by the network adapter without using the Linux network stack.

0 comment
1
Facebook Twitter Google + Pinterest
Linux
previous post
How to Find Windows Version and Build Number Installed
next post
Unlocking Active Directory User Accounts

Related Reading

Fixing ‘The Network Path Was Not Found’ 0x80070035...

August 31, 2023

Recovering Files from BitLocker Encrypted Drive

March 13, 2024

Get Started with Docker on Windows (WSL2) without...

September 4, 2024

How to Use Ansible to Manage Windows Machines

March 12, 2024

Turn Linux Computer into Wi-Fi Access Point (Hotspot)

March 11, 2024

How to Increase Size of Disk Partition in...

March 11, 2024

Printing from Linux to a Windows Shared Printer

May 29, 2024

Install Any OS from ISO Image over Network...

June 24, 2024

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Encrypt Any Client-Server App Traffic on Windows with Stunnel

    June 12, 2025
  • Failed to Open the Group Policy Object on a Computer

    June 2, 2025
  • Remote Desktop Printing with RD Easy Print Redirection

    June 2, 2025
  • Disable the Lock Screen Widgets in Windows 11

    May 26, 2025
  • Configuring Windows Protected Print Mode (WPP)

    May 19, 2025
  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Fixing ‘The Network Path Was Not Found’ 0x80070035 Error Code on Windows
  • Recovering Files from BitLocker Encrypted Drive
  • Install Any OS from ISO Image over Network with iVentoy
  • Monitoring Domain Name Expiration Date with Zabbix
  • Turn Linux Computer into Wi-Fi Access Point (Hotspot)
  • Printing from Linux to a Windows Shared Printer
  • Get Started with Docker on Windows (WSL2) without Docker Desktop
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top