WOL

OpenWrt · Subnets & VPN

Wake machines on another subnet or home LAN with OpenWrt.

Standard 102-byte magic packets are layer-2/subnet broadcasts that routers drop at subnet boundaries. Instead of exposing UDP port 9 to the internet or fighting aged ARP tables, WOL connects to your OpenWrt router over SSH and runs etherwake directly on the target LAN interface.

Understand why port-forwarding UDP 9 stops working

Routers do not forward directed subnet broadcasts from WAN by default, and forwarding UDP port 9 to a single IP (such as 198.51.100.2) only works while the router still holds that machine's MAC address in its ARP table. Five to fifteen minutes after the PC goes to sleep, the ARP entry expires and packets vanish. Sending the frame from a router already sitting on that LAN avoids the problem completely.

# Sample topology (RFC 5737 documentation addresses):
# Controller laptop (VPN / VLAN A) -> OpenWrt SSH (198.51.100.1)
# OpenWrt br-lan                   -> Sleeping target (02:00:00:00:00:01 / 198.51.100.2)

Install etherwake and verify SSH key login on OpenWrt

Sign in to your OpenWrt router and install the etherwake package. Add your controller machine's SSH public key to /etc/dropbear/authorized_keys (or LuCI -> System -> Administration -> SSH-Keys) and verify that non-interactive batch login succeeds without a password prompt.

# On OpenWrt 23.05 and earlier (opkg):
opkg update && opkg install etherwake

# On OpenWrt 24.10+ (apk):
apk add etherwake

# From your controller computer, verify non-interactive SSH:
ssh -o BatchMode=yes [email protected] true

Add the SSH relay in Wake Desk Routes and Sites

Open Wake Desk with wol, press 2 to open Routes, and press a to add your OpenWrt router (host 198.51.100.1, SSH user root, port 22, and router LAN interface br-lan). Next, press 4 to open Sites and assign that relay to your home or lab site, or assign the relay directly on an individual machine.

wol
# Press 2 (Routes) -> a (Add route): host=198.51.100.1, user=root, interface=br-lan
# Press 4 (Sites)  -> a (Add site):  subnet=198.51.100.0/24, relay=home-openwrt

Relay single or batch wakes over SSH

When you wake a machine assigned to that route, WOL validates the SSH target, user, port, interface, and MAC address, then invokes etherwake over non-interactive SSH without shell interpolation. Connect your VPN (such as WireGuard or Tailscale) when you also want live TCP status checks or remote desktop sessions to the woken host.

# Wake a saved machine whose site or profile uses the OpenWrt relay:
wol wake --device desktop --verify

# Or specify a router host directly for a one-off relayed wake:
wol wake --device desktop --router 198.51.100.1

# Wake an entire site over its configured relay:
wol batch wake --site Home --yes

Relay diagnostics

Relay TCP port is reachable in Sites check, but wake fails
Sites check tests TCP port reachability, not SSH authentication. Run ssh -o BatchMode=yes user@router true to confirm key auth and host-key trust.
etherwake runs without error, target stays asleep
Confirm the router interface name matches the bridge or VLAN carrying the wired host (for example br-lan or br-iot rather than eth0).
Machine wakes up, but WOL still shows unreachable
A relay delivers the layer-2 magic packet, while status probes run from your controller. Connect your VPN so TCP probes reach 198.51.100.2.

Ready to install WOL?

Install via Homebrew on macOS and Linux, or download a SHA-256 and Ed25519 verified release archive for macOS, Linux, or Windows.

Open install guide

PRACTICAL GUIDES

More setup guides