Bobcares

Steps to Enable Wake on LAN on Ubuntu

by | Jan 2, 2025

How to enable Enable Wake-on-LAN on Ubuntu? Read the article to learn the complete steps. At Bobcares, with our Server Management Service, we can handle your issues.

Overview
  1. How to Enable Wake-on-LAN on Ubuntu?
  2. Using NetworkManager to Enable Wake-on-LAN (Ubuntu Desktop)
  3. Using ethtool to Enable Wake-on-LAN (Ubuntu Server)
  4. Testing Wake-on-LAN
  5. Conclusion

How to Enable Wake-on-LAN on Ubuntu?

Enabling Wake-on-LAN (WOL) on Ubuntu lets us power on the PC remotely by sending a “magic packet” over the network. This feature is useful for IT administrators, gamers, and anyone needing remote access to a powered-off device. This article will guide through enabling Wake-on-LAN on both Ubuntu Desktop and Server editions.

enable wake on lan on ubuntu

Wake-on-LAN allows us to remotely turn on a device via a network by sending a special “magic packet” to the device’s network adapter. The adapter receives the packet and signals the computer to power on, provided the functionality is supported and enabled.

Using NetworkManager to Enable Wake-on-LAN

For Ubuntu Desktop, NetworkManager simplifies using Wake-on-LAN:

1. Determine the Right Network Interface

List available network connections:

nmcli connection show

Identify the connection name (e.g., Wired connection 1) and device name (e.g., enp1s0) from the output.

2. Retrieve the Network Adapter’s MAC Address

Use the device name to find the MAC address:

nmcli device show "" | grep "GENERAL.HWADDR"

The MAC address will look like 52:54:00:87:6C:0B.

3. Check Current Wake-on-LAN Setting

Verify the current WOL status:

nmcli connection show "" | grep 802-3-ethernet.wake-on-lan

If it says default, WOL is disabled.

4. Enable Wake-on-LAN

Activate WOL using the following command:

nmcli connection modify "" 802-3-ethernet.wake-on-lan magic

5. Disable Wake-on-LAN (Optional)

To turn off WOL, run:

nmcli connection modify "" 802-3-ethernet.wake-on-lan ignore

Using ethtool to Enable Wake-on-LAN

If we’re using Ubuntu Server or do not have NetworkManager, we can use ethtool to enable WOL.

1. Install Required Tools

Update and install ethtool:

sudo apt update
sudo apt install ethtool -y

2. Find the Network Adapter

List network devices:

ip a

Identify the Ethernet adapter (e.g., enp1s0) based on the IP address and other details.

3. Check WOL Support

Verify if WOL is supported:

sudo ethtool "" | grep "Wake-on"

Look for the letter g in Supports Wake-on, indicating magic packet support.

4. Enable Wake-on-LAN

Activate WOL:

sudo ethtool -s "" wol g

5. Persist Wake-on-LAN After Reboot

Create a systemd service to ensure WOL remains active after reboots:

sudo nano /lib/systemd/system/wakeonlan.service

Add the following:

[Unit]
Description=Enable Wake On Lan




[Service]
Type=oneshot
ExecStart=/usr/sbin/ethtool -s wol g




[Install]
WantedBy=basic.target


Save the file and enable the service:

sudo systemctl enable wakeonlan.service

Testing Wake-on-LAN

To test, use a Wake-on-LAN app or tool on another device, input the MAC address, and send a magic packet. The Ubuntu device should power on if WOL is configured correctly.

[Need to know more? Click here to reach us.]

Conclusion

By following these steps, we can effectively activate and utilize Wake-on-LAN on the Ubuntu system, ensuring seamless remote management and access.

0 Comments

Submit a Comment

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

Never again lose customers to poor
server speed! Let us help you.