Online Tool Store Online Tool Store
📡 Network

· 4 min read

How to Build a Wake-on-LAN Magic Packet

Heshan Fernando

Co-founder & COO

Heshan Fernando is the Co-founder and Chief Operating Officer of Ceyentra Technologies, where he leads project management, engineering, and research and development strategy. With over nine years of industry experience, he is passionate about transforming complex customer challenges into practical, high-impact solutions. His customer-centric leadership has enabled multidisciplinary teams to consistently deliver secure, scalable, and industry-grade digital products that create lasting business value. View on LinkedIn

Share

How to Build a Wake-on-LAN Magic Packet

You want to turn on a machine you’re not standing next to. Wake-on-LAN does exactly that, it’s built into nearly every network adapter made in the last twenty years, and it fails for one of four reasons that have nothing to do with the packet.

What a magic packet is

A fixed 102-byte structure the network card recognises while the rest of the machine is powered down:

  • Six bytes of 0xFF
  • The target’s six-byte MAC address, repeated sixteen times

That’s the entire format. Send it as a UDP payload to the target’s network and the card, which stays partially powered in most sleep and soft-off states, spots the pattern and signals the motherboard to power on.

Note what isn’t in there: no authentication, no encryption, no sender identity. Anyone who can put a packet on your network segment and knows a MAC address can wake that machine. That’s why Wake-on-LAN is a local network feature and forwarding it in from the internet is a poor idea.

Why the broadcast address matters

A sleeping machine has no active IP address. The TCP/IP stack isn’t running — only the network card is listening.

So you can’t address the packet to the machine. You send it to the subnet broadcast address192.168.1.255 for a 192.168.1.0/24 network — which delivers it to every device on the segment. Each card checks the embedded MAC, and only the matching one responds.

This is why Wake-on-LAN doesn’t work over the internet: broadcast traffic doesn’t cross routers. Waking a machine remotely needs either a VPN into the network, or a device already awake on that segment to relay the packet — a router with the feature built in, or a small always-on machine.

Some setups use a directed broadcast forwarded by the router, which works and is disabled by default on most equipment for good reasons.

The four things that stop it working

Wake-on-LAN disabled in BIOS/UEFI. Usually called “Wake on LAN”, “Power on by PCI-E”, or something similar. Off by default on many machines.

Disabled on the adapter in the operating system. A separate setting from the firmware one, in the adapter’s power management properties. Both need to be on.

Fast startup. On Windows in particular, the default “fast startup” shutdown puts the machine in a hybrid state where the adapter may not be powered. Machines that wake from sleep but not from shutdown almost always have this enabled.

Wrong broadcast address. Sending to the machine’s last known IP, or to the wrong subnet.

SymptomLikely cause
Wakes from sleep, not from offFast startup, or firmware setting
Never wakes at allAdapter setting, or wrong broadcast
Works locally, not remotelyBroadcast doesn’t cross routers
Worked, then stoppedDriver update reset the adapter setting

Common mistakes to avoid

  • Sending to the machine’s IP address rather than the subnet broadcast.
  • Enabling it in the OS and not in firmware, or the reverse.
  • Forwarding the port from the internet, which exposes a completely unauthenticated wake capability.
  • Assuming a machine on Wi-Fi will wake — many wireless adapters don’t support it, and those that do often need a specific mode enabled.
  • Testing once after a shutdown, when the fast startup setting means shutdown and sleep behave differently.

How to do it with Wake-on-LAN Packet Builder

The Wake-on-LAN Packet Builder constructs the payload correctly.

  1. Enter the target’s MAC address in any common separator format.
  2. Set the subnet broadcast address, not the machine’s own IP.
  3. Send on UDP port 9 from a device on the same subnet.
  4. If nothing happens, check firmware, adapter settings and fast startup before suspecting the packet.

Other network tools are in the tools directory.

Frequently asked questions

Why does it need a broadcast address?

Because the sleeping machine has no active IP for the network to route to. The packet goes to the subnet broadcast, every device sees it, and only the card matching the MAC responds.

Why doesn’t Wake-on-LAN work over the internet?

Broadcast traffic doesn’t cross routers. Waking remotely needs a VPN into the network, or a device already awake on that subnet to relay the packet.

What has to be enabled on the target?

Wake-on-LAN in the BIOS or UEFI, and the wake option on the network adapter in the operating system. Many machines also disable it after a fast-startup shutdown.

Final thought

If the packet is right and nothing happens, the problem is a setting on the target. Check fast startup first — it’s the one that makes a machine wake from sleep and stay dead after a shutdown.

Try the free Wake-on-LAN Packet Builder

#wake-on-lan#magic-packet#remote-power-on#broadcast-address#online-tools#free-tools