How to Stop Ubuntu from Automatically Waking Up from Sleep (Wake-on-LAN)

If you put your Ubuntu Linux desktop to sleep at the end of the day, you might occasionally walk into your office the next morning to find the computer powered on, fans spinning, and the lock screen fully illuminated. One of the most common culprits for a computer mysteriously waking itself up from suspend is a network protocol called Wake-on-LAN (WoL).

When Wake-on-LAN is enabled, your computer’s network interface card (NIC) remains partially active even while the rest of the system is asleep. It listens for a specific “magic packet” sent over the network. If it receives one, it sends a hardware interrupt that forces the motherboard to instantly wake the computer up. Unfortunately, overly aggressive network routers or misconfigured devices on your local network can occasionally send stray packets that accidentally trigger this wake event.

If you do not remotely manage your Ubuntu machine, you should completely disable Wake-on-LAN to ensure the computer remains deeply asleep until you physically press the power button.

How to Disable Wake-on-LAN in Ubuntu

You must use the ethtool utility to change the behavior of your network interface card.

  1. Open your terminal application (Ctrl+Alt+T).
  2. First, identify the name of your ethernet interface by running: ip a (Look for a name starting with en, such as enp3s0 or eth0).
  3. Check the current Wake-on-LAN status of that interface using ethtool (replace enp3s0 with your actual interface name):

sudo ethtool enp3s0

  1. Look for the line that says Wake-on: g. (The ‘g’ means it is listening for magic packets).
  2. To disable it, run the following command to set the status to ‘d’ (disabled):

sudo ethtool -s enp3s0 wol d

The network interface card will immediately stop listening to the network while the computer is suspended. Your Ubuntu machine will now remain perfectly asleep, completely immune to rogue network activity.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.