Wake-on-LAN Setup and Troubleshooting on Ubuntu | Easy Remote Boot

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

WoL is a technology that allows you to remotely power on a PC by sending a special network packet called a “Magic Packet.” It is useful in various 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 check this using the ethtool command.

How to Check Your Network Card

  1. Run ethtool <network device name> to check if WoL is supported. If the output includes “Supports Wake-on: g,” it means your device supports Magic Packet-based wake-up.
  2. If the output includes “d: Disabled,” WoL may be disabled in the BIOS or network card driver. Follow the troubleshooting steps mentioned later to verify and enable the setting.

3. Enabling WoL in BIOS

You need to enable WoL in your BIOS settings. Here are the general steps:

Steps to Enable WoL in BIOS

  1. Restart your PC and access the BIOS by pressing F2, F12, Del, or a similar key.
  2. Find and enable the “Wake-on-LAN” or “Wake on PCI Event” option.
  3. If there is a “Deep Sleep” mode, disabling it may improve WoL functionality.

4. Configuring WoL on Ubuntu

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

Enabling WoL Using NetworkManager

  1. Check the current connection name with nmcli connection show and enable WoL using the following command:
   nmcli connection modify "<connection name>" 802-3-ethernet.wake-on-lan magic

Enabling WoL Using ethtool

  1. Enable Magic Packet wake-up with ethtool --change <network device name> wol g.
  2. To make the setting persistent, add up ethtool -s <device name> wol g to the /etc/network/interfaces file or create a systemd unit to apply it automatically on boot.

5. Common Error Messages and Their Solutions

Here are some common error messages you might encounter while configuring WoL, along with their causes and solutions.

netlink error: cannot enable unsupported WoL mode

  • Cause: This error occurs if your network card or BIOS does not support WoL.
  • Solution: Check if WoL is enabled in the BIOS. If your hardware does not support it, consider using a WoL-compatible network card.

Wake-on: d is displayed

  • Cause: WoL is disabled.
  • Solution: Enable WoL in the BIOS and use the command ethtool --change <device name> wol g to enable it. If it remains disabled, check the persistence settings in your network configuration.

Magic Packet is not received

  • Cause: Your network configuration or router might be blocking WoL broadcast packets.
  • Solution: Use tcpdump -i <network device name> 'udp and port 9' to check if Magic Packets are being received. Also, ensure that WoL works within the same network.

Link light does not turn on

  • Cause: The network adapter is not receiving power.
  • Solution: Check the BIOS settings to ensure that Deep Sleep or power-saving modes are disabled so that WoL can function correctly.

6. Testing and Running WoL Remotely

After setting up WoL, you can test if it works correctly by sending a Magic Packet using wakeonlan or etherwake.

Installing and Using the wakeonlan Tool

  1. Install the wakeonlan tool:
   sudo apt install wakeonlan
  1. Send a Magic Packet to a specific MAC address using the following command:
   wakeonlan <MAC address>
  1. You can also use etherwake with the following command:
    sudo etherwake <MAC address>
    This will send a Magic Packet and verify whether WoL is functioning properly.

7. Troubleshooting and Additional Information

Here are some additional troubleshooting tips to ensure your WoL setup works smoothly.

  • Check AC Power: WoL typically does not work when running on battery power. If you are using a laptop, make sure it is plugged into an AC power source.
  • Consistency in Network Management Tools: Sometimes, NetworkManager or systemd-networkd can override WoL settings. Ensure that WoL configurations are correctly set across different network management tools.
侍エンジニア塾