How to enable Wake-on-LAN on Ubuntu 24.04 on a Mini PC

I recently set up Wake-on-LAN on my mini PC running Ubuntu 24.04.3 LTS, and in this post I’ll walk you through every step I took to get it working — and ensure it stays working after reboot!
🔍 Step 1: Install ethtool
This tool lets you check and configure Wake-on-LAN:
sudo apt update
sudo apt install ethtool
🔌 Step 2: Identify Your Network Interface
Find your Ethernet device name (mine was enp1s0):
ip link
Then confirm its WoL capability:
sudo ethtool enp1s0
You should see something like:
Supports Wake-on: pumbg
Wake-on: d
The d means it’s currently disabled. We want it to say g for “magic packet”.
⚡ Step 3: Enable WoL Temporarily (Test It)
To test if WoL works at all, enable it manually:
sudo ethtool -s enp1s0 wol g
Recheck:
sudo ethtool enp1s0
You’ll see:
Wake-on: g
🛠️ Step 4: Make It Permanent With udev
Create a persistent rule so it applies every time the system boots:
sudo nano /etc/udev/rules.d/70-wake-on-lan.rules
Paste this (adjust interface name if yours is different):
ACTION=="add", SUBSYSTEM=="net", NAME=="enp1s0", RUN+="/usr/sbin/ethtool -s enp1s0 wol g"
Then reload udev and trigger the rule:
sudo udevadm control --reload
sudo udevadm trigger
Reboot and verify:
sudo reboot
sudo ethtool enp1s0
✅ If it still shows Wake-on: g, you’re good to go!
🧷 Step 5: Stop NetworkManager From Undoing It
Check your active connection name:
nmcli connection show
In my case, it was netplan-enp1s0. Then run:
sudo nmcli connection modify "netplan-enp1s0" 802-3-ethernet.wake-on-lan magic
sudo nmcli connection up "netplan-enp1s0"
🎉 Final Result
After all that, running:
sudo ethtool enp1s0
shows:
Wake-on: g
This means Wake-on-LAN is enabled and will persist through reboots. Now I can remotely power on my mini Ubuntu PC from anywhere on my network with a magic packet!
📦 Bonus Tip
You can use apps like Mocha WOL (iOS) or Wake On Lan (Android), or install the wakeonlan tool on another Linux PC:
sudo apt install wakeonlan
wakeonlan XX:XX:XX:XX:XX:XX
Replace XX:XX:XX... with your PC’s MAC address.
Thanks for reading! Have questions or got stuck? Leave a comment and I’ll try my best to help!
