SWRU576 January 2021 WL1801MOD , WL1805MOD , WL1807MOD , WL1831MOD , WL1835MOD , WL1837MOD
The magic packet is a broadcast frame containing anywhere within its payload 6 bytes of all 255 (FF FF FF FF FF FF in hexadecimal), followed by sixteen repetitions of the target computer's 48-bit MAC address, for a total of 102 bytes.
Since the magic packet is only scanned for the string above, and not actually parsed by a full protocol stack, it may be sent as any network and transport-layer protocol, although it is typically sent as a UDP datagram to port 7 or 9, or directly over Ethernet as EtherType 0x0842.
The wl18xx firmware does not support scanning of the entire Ethernet frame for the magic packet. Besides, as mentioned before, the max size of a pattern is 81 bytes.
However, it is possible to define patterns that can dissect an actual implementation of the magic packet by comparing a subset of the actual magic packet. An example is shown below:
Wakeup on magic packet with EtherType = 0x0842 or UDP port no: 9
iw phy0 wowlan enable patterns 01:02:03:04:05:06:-:-:-:-:-:-:08:00:45:-:-:-:-:-:-:-:-:11:-:-:-:-:-:-:C0:A8:01:04:-:-:00:09:-:-:-:-:ff:ff:ff:ff:ff:ff:01:02:03:04:05:06:01:02:03:04:05:06 01:02:03:04:05:06:-:-:-:-:-:-:08:42:ff:ff:ff:ff:ff:ff:01:02:03:04:05:06:01:02:03:04:05:06
Where,
01:02:03:04:05:06 -> Destination MAC ID C0:A8:01:04 -> Destination IP address (192.168.1.4)
The utilities "etherwake" or "wakeonlan" (on Linux) or "Wol Wake on Lan Wan" (Android) can be used to wake up the WL18xx host after setting the above pattern.
Command to run on the remote (Ubuntu) machine:
# etherwake -iwlan2 -D 01:02:03:04:05:06
OR
# wakeonlan -i 192.168.1.4 01:02:03:04:05:06