How to Enable Wake-on-LAN in Ubuntu
We all like to automate things: cars, homes, and especially computers. Wake-on-LAN is the perfect way to automatically turn on your PC. While this guide focuses on enabling Wake-on-LAN in Ubuntu , you can apply it to any Linux distribution and you can even find the feature in Windows.
What is Wake-on-LAN?
Wake-on-LAN is a networking standard that allows you to turn on or wake up your computer using a network message. This message, called a Magic Packet, is sent from another device on the same local network or even over a wireless network.
The Magic Packet contains the MAC address of the target computer's network interface card (NIC), which uniquely identifies the hardware. When the NIC, which remains in a low-power state even when the computer is off, receives this packet, it signals the motherboard to power on the system.
Preparing to setup for Wake-on-LAN
Before you begin, make sure you meet the following basic requirements:
- Wired Ethernet connection (Wi-Fi WoL is limited and often unreliable)
- Compatible motherboard and network card (most modern ones support it)
- BIOS/UEFI settings that support WoL
- Administrative access to Ubuntu machine
Check hardware and BIOS settings
First, you need to make sure your hardware supports Wake-on-LAN. Most modern desktops and many laptops do, but it's worth double-checking.
Restart your computer and press the appropriate key to enter BIOS/UEFI (usually F2, F10, Del, or Esc – watch the screen as it boots). Look for options like Wake-on-LAN, Power on by PCI-E, PCI Power Up, or Allow PCI Wake-Up Event. The exact names vary by manufacturer. Set the option to Enabled .
You may also want to disable features called ErP Ready or Deep Sleep, as these power-saving modes can completely cut off power to the network card, preventing it from receiving magic packets. Some laptops also require settings like Always On USB to keep the network card powered when shut down or hibernating.
Check if the network card supports Wake-on-LAN
For Wake-on-LAN to work, your Ethernet card needs to support it. This has been standard for at least 10 years, so there's a good chance your card does, but you should double check.
The Ethernet Interface is the device's network card. Each card has a unique name which is found with the following terminal command:
ip a
The name you are looking for is similar to enp8s0. This is the unique ID of the network card used in this guide.
Ethtool is an open source application that allows you to change network driver settings. For Wake-on-LAN, it allows the PC to understand the data it is receiving.
The command to install ethtool is:
sudo apt install ethtool
Next, find out if your network card supports Wake on LAN.
sudo ethtool
You will be provided with detailed information about your Ethernet interface hardware. We are looking for:
Supports Wake-on: g Wake-on: g
The first line tells you whether your PC supports Wake-On-LAN. There may be other letters along with the g. For now, we just need the g.
The second line indicates whether Wake-On-LAN is enabled or not. Don't worry too much about that, because our next task will be to enable it.
Enable Wake-on-LAN temporarily
Enabling Wake-on-LAN will require the NIC to wake up the system only when a specific magic packet is received.
To enable Wake-on-LAN temporarily, run:
sudo ethtool -s wol g
This enables WoL until the next reboot. To verify that it works, run:
sudo ethtool
If you see Wake-on: g, it means that WoL was successfully enabled. However, the settings applied by ethtool are not persistent and will be lost after a reboot.
Enable Wake-on-LAN permanently
For Wake-on-LAN to be truly useful, it needs to be enabled even after your Ubuntu machine reboots. We can do this by creating a systemd service that automatically runs the ethtool command at boot. This is a common and robust way to ensure that settings persist in modern Linux distributions.
First, create a new systemd service file. We'll use nano, a simple text editor, but you can use Vi or any other editor you like:
sudo nano /etc/systemd/system/wol.service
If you are not sure where ethtool is installed, run:
which ethtool
Paste the following content into the service file:
[Unit] Description=Enable Wake On Lan [Service] Type=oneshot ExecStart = --change wol g [Install] WantedBy=basic.target
Once you have pasted the content and made your substitutions, save the file and exit nano. To do this, press Ctrl + X , then Y to confirm the save, and finally Enter to confirm the file name.
Finally, we need to tell systemd to enable this new service so that it runs at boot. This creates a symbolic link that enables the service:
sudo systemctl enable wakeonlan.service
Once enabled, you can optionally start the service immediately without rebooting with the following command:
sudo systemctl start wakeonlan.service
Now your Ubuntu Server or Desktop will always have Wake-on-LAN enabled during reboots.
Using the advanced network connection editor
For most Ubuntu desktop users, the graphical network connections editor provides the simplest way to enable Wake-on-LAN.
Just open advanced network connection settings from the app menu.
In the Network panel, you will see your wired connection listed. Click the gear icon and open the connection settings.
In the Ethernet settings tab, look for Wake on LAN. Check the box labeled Magic or MagicPacket and press Apply .
That's it! You have successfully enabled Wake-on-LAN. To verify, run:
sudo ethtool enp0s3
Look for Wake-on: g in the output.
You should read it
- How to enable / disable the Allow Wake Timers option in Windows 10
- Learn about the nature of Wake-On-LAN feature
- How to wake up on time in the morning
- Fix Wake on Lan error not working on Windows 10
- How to turn on Wake-on-lan on Windows 10 to turn on and start the remote computer
- How to Prevent a Computer from Waking Up from External Devices
- Offering For Honor downloads ($ 21.99) and Alan Wake ($ 5.99), two 'super product' titles are available for a while.
- How to add / remove 'Allow wake timers' from Power Options in Windows 10
May be interested
- How to turn on Wake-on-lan on Windows 10 to turn on and start the remote computerwake-on-lan (wol) is a remote boot feature. wake-on-lan allows the computer to 'listen' to a 'magic packet' that contains a mac address to wake up a computer over a lan or internet.
- Why is Ubuntu LTS preferred over regular distros?ubuntu is one of the most widely used linux distributions among software developers and other content creators. ubuntu is also used for many servers around the globe.
- What's new in Ubuntu 18.04 LTS just released?ubuntu 18.04 lts code-named bionic beaver has just been officially launched on april 26th. this version is canonical's up to 5 year support period.
- How to prolong the life of Ubuntu 18.04 installation with Ubuntu Proubuntu 18.04, bionic beaver, is one of the most popular distros in use today, but support will end in may 2023, meaning you won't receive updates or security patches anymore.
- What is the difference between Ubuntu Desktop and Ubuntu Server?ubuntu is divided into ubuntu cloud, ubuntu core, ubuntu kylin, ubuntu desktop and ubuntu server. in this article, we will explore all the similarities and differences between ubuntu server and ubuntu desktop.
- How to Enable Oracle Java in Your Web Browsers on Ubuntu Linuxthis document covers enabling 32-bit and 64-bit oracle java browser plugin in 32-bit ubuntu linux and 64-bit ubuntu linux. for the two most popular web browsers for ubuntu linux at this time, which are google chrome and mozilla firefox....
- Instructions on how to encrypt files and folders on Ubuntuubuntu possesses many advanced security features that users may not know about. for example, libreoffice users can encrypt files and folders on ubuntu extremely simply but extremely securely. so what is that feature and how to use it on ubuntu for files and folders?
- How to Prevent a Computer from Waking Up from External Devicesif you've experienced your computer suddenly turning itself on after you've put it to sleep or you've just shut it down, you may need to investigate what's causing it to wake up. the common causes that wake up your computer are hardware...
- Enable Root account in Ubuntuthere is a sudo command in ubuntu that allows you to perform any administrative tasks in place of root account permissions. if you use another linux favorite tool and perform any administrative tasks on it, you will feel a little forced by sudo, although you can do anything like an account. root with sudo
- Offering For Honor downloads ($ 21.99) and Alan Wake ($ 5.99), two 'super product' titles are available for a while.currently on the epic store, there is a free donation program that has been rated for super products for for honor for $ 21.99 and alan wake for $ 5.99 for a short time.