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.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF