Software & AppsOperating SystemLinux

How To Troubleshoot Wakeonlan on Ubuntu 20.04

Ubuntu 16

In this article, we will delve into the process of troubleshooting Wake-on-LAN (WoL) issues on Ubuntu 20.04. Wake-on-LAN is a feature that allows you to remotely wake up a computer over a network. However, it can sometimes be challenging to set up and troubleshoot, especially on different operating systems and hardware configurations.

Quick Answer

To troubleshoot Wake-on-LAN on Ubuntu 20.04, you need to check if it is enabled on your Ethernet adapter using the ethtool command. If it is disabled, you can enable it with the sudo ethtool -s [interface-name] wol g command. Additionally, you may need to check and adjust settings in TLP and Netplan configuration files.

Prerequisites

Before we start, ensure that you have administrative access to your Ubuntu 20.04 system. Also, your system’s BIOS/UEFI must support Wake-on-LAN and it should be enabled.

Installing Necessary Tools

First, we need to install two critical tools: ethtool and wakeonlan. The ethtool utility allows us to view and change the Ethernet adapter settings, while wakeonlan is used to send ‘magic packets’ to wake up the system.

sudo apt-get update
sudo apt-get install ethtool wakeonlan

Checking Wake-on-LAN Status

To check if Wake-on-LAN is enabled on your Ethernet adapter, use the ethtool command followed by the name of your network interface. You can find the interface name using the ifconfig -a command.

ethtool [interface-name]

Look for the “Wake-on” line in the output. If it says “g”, Wake-on-LAN is enabled. If it says “d”, Wake-on-LAN is disabled.

Enabling Wake-on-LAN

If Wake-on-LAN is disabled, you can enable it using the following command:

sudo ethtool -s [interface-name] wol g

The -s option is used to change the settings of the specified network interface, while wol g enables Wake-on-LAN.

Making Wake-on-LAN Persistent

The above settings will be lost after a system reboot. To make them persistent, we can create a script that runs at startup.

Create a new script file:

sudo nano /etc/network/if-up.d/wol_fix

Add the following content:

#!/bin/sh

ethtool -s [interface-name] wol g

Make the script executable:

sudo chmod +x /etc/network/if-up.d/wol_fix

Troubleshooting TLP Settings

TLP is a power management tool for Linux. It has a setting that can disable Wake-on-LAN. To check this setting, open the TLP configuration file:

sudo nano /etc/tlp.conf

Look for the WOL_DISABLE setting. If it’s set to Y, Wake-on-LAN is disabled. Change it to N to enable Wake-on-LAN.

WOL_DISABLE=N

Save the changes and exit the editor. Then, restart TLP:

sudo systemctl restart tlp

Troubleshooting Netplan Configuration

Netplan is a utility for configuring networking on a Linux system. It can also be used to enable Wake-on-LAN.

Open the appropriate Netplan configuration file in the /etc/netplan/ directory:

sudo nano /etc/netplan/[file-name].yaml

Add the wakeonlan: true option to the interface entry for your Ethernet adapter:

network:
 version: 2
 ethernets:
 [interface-name]:
 wakeonlan: true

Apply the changes:

sudo netplan apply

Conclusion

Troubleshooting Wake-on-LAN on Ubuntu 20.04 involves checking and changing settings in multiple places, including the Ethernet adapter, TLP, and Netplan. However, with the right tools and knowledge, it’s a manageable task. Remember, your system’s BIOS/UEFI and network infrastructure must also support Wake-on-LAN for it to work properly.

For more information, refer to the official Ubuntu documentation here.

What is Wake-on-LAN (WoL)?

Wake-on-LAN is a feature that allows you to remotely wake up a computer over a network. It sends a special packet, known as a magic packet, to the computer’s network interface card, triggering it to power on.

How can I check if Wake-on-LAN is enabled on my Ubuntu 20.04 system?

You can use the ethtool command followed by the name of your network interface to check the Wake-on-LAN status. Look for the "Wake-on" line in the output. If it says "g", Wake-on-LAN is enabled. If it says "d", Wake-on-LAN is disabled.

How can I enable Wake-on-LAN on my Ubuntu 20.04 system?

If Wake-on-LAN is disabled, you can enable it using the command sudo ethtool -s [interface-name] wol g. Replace [interface-name] with the name of your network interface.

How can I make Wake-on-LAN settings persistent after a system reboot?

To make Wake-on-LAN settings persistent, you can create a script that runs at startup. Use the command sudo nano /etc/network/if-up.d/wol_fix to create a new script file. Add the appropriate content to enable Wake-on-LAN, save the file, and make it executable using sudo chmod +x /etc/network/if-up.d/wol_fix.

Can TLP settings affect Wake-on-LAN on Ubuntu 20.04?

Yes, TLP is a power management tool for Linux and it has a setting that can disable Wake-on-LAN. You can check the WOL_DISABLE setting in the TLP configuration file (/etc/tlp.conf). If it’s set to Y, Wake-on-LAN is disabled. Change it to N to enable Wake-on-LAN and restart TLP using sudo systemctl restart tlp.

How can I enable Wake-on-LAN using Netplan on Ubuntu 20.04?

Netplan is a utility for configuring networking on a Linux system. To enable Wake-on-LAN using Netplan, open the appropriate Netplan configuration file in the /etc/netplan/ directory using sudo nano /etc/netplan/[file-name].yaml. Add the wakeonlan: true option to the interface entry for your Ethernet adapter, save the file, and apply the changes using sudo netplan apply.

Leave a Comment

Your email address will not be published. Required fields are marked *