

- #WOL WAKE ON DIRECTED PACKET WAKE ON MAGIC PACKET 64 BITS#
- #WOL WAKE ON DIRECTED PACKET WAKE ON MAGIC PACKET MAC#
In this case replace $Broadcast address by the destination public IP, and open/forward the specified $PortNumber (UDP) on destination.

The above one-line bash command should work too for wake on LAN via internet.The specific port number seems not to be important on WOL. NetCat's OpenBSD version has a bug as for today (Juy 2015) on broadcast data sending ( -b), so you will have to replace it by NetCat Traditional version (netcat-traditional package on apt-get installers).CygWin's NetCat version doesn't need for -b parameter.
#WOL WAKE ON DIRECTED PACKET WAKE ON MAGIC PACKET 64 BITS#
Tested working on Ubuntu, Kali and even CygWin (Windows 7 SP 1 64 bits ). SoCat can be used instead (syntax will differ, of course).
#WOL WAKE ON DIRECTED PACKET WAKE ON MAGIC PACKET MAC#
The sed command is used here to remove colons ( :) from the MAC and to add the \x hex specificator (so that 11 becomes \x11, 22 becomes \x22.The WOL magic packet is composed of ffffffffffff (12 times f) followed by 16 times the destination MAC without colons ( :).The command line would be: echo -e $(echo $(printf 'f%.0s' ) | sed -e 's/./\\x&/g') | nc -w1 -u -b $Broadcast $PortNumber Bash supporting brace expansion (I think it is v3.5.1 and above).The received WOL Packet contains MAC Address 00E04C3103AC and empty password.The minimum requirements I can think off: The example below shows the packet sent from IP 192.168.1.4 to subnet-directed broadcast address 192.168.1.255 and destination port 7. Start your Wake-On-Lan tool which be used to send out magic packets. Start Wake-on-LAN Packet sniffer on the target (tested) machine.Last two ways requires configuration of the routers for each subnet. If the router or switch still has cached what port that computer is attached to, packet gets access to the machine. Unicast: the Packet sent directly to the machine IP address.

The router or switch will forward the packet to all the machines on the subnet.
