go-wol: Wake on LAN in Go

p2p_network_compgo-wol is Wake on LAN packet generator written in Go. Wol on LAN (WOL) is a data link layer protocol to wake up systems remotely by sending a magic packet to the network card. Note that WOL should be supported by the hardware. Normally there is a setting in system BIOS to enable or disable WOL.

The WOL enabled device listens for a magic packet with its MAC address encoded in WOL scheme. As the protocol works in the data link layer, IP address is irrelevant. The magic packet has 6 bytes of 0xff followed by 16 repetitions of the target device’s MAC address (total of 102 bytes). go-wol generates this magic packet with the MAC address provided by the user and sends it out as a UDP broadcast.


  • Wake up devices remotely using WOL
  • Store and manage MAC address aliases


To install the package you need to have golang packages installed on your device. Run the following commands to install go-wol:

$ sudo apt-get install golang
$ go get github.com/sabhiram/go-wol


  • Wake up a device
    $ wol wake 00:11:22:aa:bb:cc
  • Store an alias
    $ wol alias skynet 00:11:22:aa:bb:cc

    Aliases are stored in ~/.config/go-wol/aliases

  • Wake up a device using alias
    $ wol wake skynet
  • List aliases
    $ wol list
  • Delete an alias
    $ wol remove skynet
  • Specify broadcast IP and port
    $ wol wake 00:11:22:aa:bb:cc -b -p 7
    $ wol wake skynet --bcast --port 7

    Default broadcast IP:, port: 9

  • Supported MAC address formats
  • Unsupported MAC address formats
    01 23 45 56 67 89

On GitHub: go-wol

Leave a Reply

Your email address will not be published. Required fields are marked *