Posted on ::

What?🔗

I stumbled recently upon the fact that you can wake up a suspended Linux host over wifi, not just Ethernet. The feature is called WoWLAN — Wake on Wireless LAN — and, I must say, it took me by surprise.

For me wifi always needs some complex dance to re-connect, and I could not imagine it could work. But with WoWLAN the card keeps running in a low-power listening mode, still associated to the access point, and it can wake the whole host when it sees the right packet. It is the wireless sibling of Wake-on-LAN, with one obvious advantage: no cable.

Why?🔗

I am setting up two cheap Linux "AI servers" at home:

  • a discounted "Virtual Reality" Zotac "PC in a backpack" with a GPU I have been using for two years now to transcribe confcalls with Whisper.
  • a cheap PC with 3 GPUs of 12GB VRAM each made of spare parts and cheap second hand ones, to toy with the current ever-evolving crop of open source LLMs that are more powerful by the week.

I wanted to suspend them when not actively running AI, but wake them transparently on demand. And with wifi, this meant I could move their noise and heat easily away from my "work" room.

How?🔗

Linux exposes it through the iw tool, which is the least surprising part. Something like:

iw phy0 wowlan show
sudo iw phy0 wowlan enable magic-packet disconnect

You can wake on a magic packet, on a disconnect, on any packet, or a combination. Then put the machine to sleep, fire a magic packet from your phone or another machine, and it comes back. A phone is the natural partner here — wake your laptop from the sofa before you even walk to it.

Alas, it does not work everywhere. Not all wifi cards and drivers support it, so check the output of iw list first. Intel cards are generally well served. The card also has to stay powered during suspend, so a machine that cuts wifi power entirely in suspend will not cooperate. And some distributions or NetworkManager versions may reset the setting at boot, so you may need to re-enable it — a systemd service fixes that.

The tutorial I used, from cyberciti.biz: how to configure wireless wake-on-lan for your Linux wifi card, walks through the whole thing: finding your phy, checking support, enabling WoWLAN, and testing it with echo mem > /sys/power/state. For the low-level details, the official Linux wireless docs are the reference.

The idea that a machine with a sleeping CPU is still listening for a whispered packet over the radio — and will wake up at a shout — amazes me more than it probably should :-)

Table of Contents