How to Enable and Use Wake-on-LAN (WoL) on Ubuntu: Complete Setup & Troubleshooting Guide

1. What Is Wake-on-LAN (WoL)?

Wake-on-LAN (WoL) is a technology that allows you to power on a PC remotely by sending a special network packet called a “Magic Packet.” It is useful in a variety of situations, such as remote server management or accessing your work PC from home.

2. Checking WoL-Compatible Hardware

To use WoL, your network card and motherboard must support it. You can verify compatibility using the ethtool command.

How to Check Your Network Card

  1. Run ethtool <network-device-name> and verify whether WoL is supported. If the result includes “Supports Wake-on: g,” the device can be powered on via Magic Packet.
  2. If the result displays “d: Disabled,” WoL may be disabled in the BIOS or network driver settings. Refer to the troubleshooting section below to fix the configuration.

3. Configuring WoL in the BIOS

You must enable WoL in the BIOS settings. The exact menu varies by manufacturer, but the following steps are common:

Steps to Enable WoL in BIOS

  1. Restart the PC and access BIOS using keys such as F2, F12, or Del.
  2. Enable options such as “Wake-on-LAN” or “Wake on PCI Event.”
  3. If available, disable Deep Sleep mode to improve WoL functionality.

4. Configuring WoL on Ubuntu

On Ubuntu, you can enable WoL using either NetworkManager or ethtool.

Using NetworkManager

  1. Check your current connection name using nmcli connection show, then enable WoL with the following command:
   nmcli connection modify "&lt;connection-name&gt;" 802-3-ethernet.wake-on-lan magic

Using ethtool

  1. Enable Magic Packet with ethtool --change <network-device-name> wol g.
  2. To persist the configuration, add up ethtool -s <device-name> wol g to the /etc/network/interfaces file, or create a systemd unit to apply the setting at boot time.

5. Common Error Messages and Solutions

Below are common WoL-related errors along with causes and solutions.

netlink error: cannot enable unsupported WoL mode

  • Cause: Your network card or BIOS does not support WoL.
  • Solution: Confirm WoL is enabled in BIOS. If unsupported, install a WoL-capable network card.

If “Wake-on: d” Is Displayed

  • Cause: WoL is disabled.
  • Solution: Enable WoL in BIOS and run ethtool --change <device-name> wol g. If it remains disabled, verify persistent network configuration.

Magic Packet Not Received

  • Cause: Your router or network configuration may be blocking broadcast packets.
  • Solution: Check packet reception using tcpdump -i <network-device-name> 'udp and port 9'. Also ensure WoL is used within the same local network.

No Link Light on the Network Port

  • Cause: The network adapter is not receiving power.
  • Solution: Disable Deep Sleep or power-saving features in BIOS to allow WoL operation.

6. Testing and Executing WoL Remotely

After configuring WoL, you can use wakeonlan or etherwake to send Magic Packets and confirm functionality.

Installing and Using wakeonlan

  1. Install the wakeonlan tool.
   sudo apt install wakeonlan
  1. Send a Magic Packet by specifying the MAC address:
   wakeonlan &lt;MAC-address&gt;
  1. You can also use etherwake with sudo etherwake <MAC-address>. This sends a Magic Packet to verify WoL operation.

7. Troubleshooting and Additional Tips

Consider the following additional tips when WoL does not behave as expected:

  • AC Power Requirements: WoL typically does not work on battery power. Ensure laptops are connected to AC power.
  • Network Configuration Consistency: Settings may reset when switching between NetworkManager or systemd-networkd. Ensure both tools use consistent WoL settings.