How to enable and use Wake on LAN this article I will describe how to enable Wake-on-LAN (WOL) and how to use it to start-up a system remotely. In order to use Wake-on-LAN your systems hardware and network driver needs to actually support this technology. You will also need to know the MAC address of the systems ethernet card.


  1. Enable Wake-on-LAN
    Enable Wake on LAN in BIOS. Sometimes the option is not addressed as “Wake-on-LAN”, but instead as “PCI Power up”, “OnBoard LAN Boot Rom” or similar.

  2. Find the network device
    Boot into Linux and find out your Ethernet cards device name and MAC address by using this command:

    $ ip link

    or use this command:

    $ ifconfig

    My ethernet cards device name is eth0, so replace in all of the following commands eth0 by your cards device name.

  3. Check the drivers Wake-on-LAN support and settings
    We will use the ethtool to check whether the network device and its driver support Wake-on-LAN and to activate it. Install ethtool from your distros repository or download it from here and then proceed like this:

    $ sudo ethtool eth0 | grep Wake-on

    Possible Output:

    Supports Wake-on: pg
    	Wake-on: d

    As you can see my device supports the wake on methods “p” and “g”. The meaning of these methods is described in the table below. Furthermore we can see that the “Wake-on” option is set to “d” (meaning disabled).

    p Wake on PHY activity
    u Wake on unicast messages
    m Wake on multicast messages
    b Wake on broadcast messages
    a Wake on ARP
    g Wake on MagicPacket™
    s Enable SecureOn™ password for MagicPacket™
    d d Disable (wake on nothing).

    source: ethtool man pages

  4. Change the drivers settings and shut down for the first test
    Now we want to change the “Wake-on” method to “g”, which means that the system will wake up when it receives an MagicPacket™ addressed to its MAC address. You can do it like this:

    $ sudo ethtool -s eth0 wol g

    You may want to check if it successfully changed to “g” by using the command from step 3) again. If everything is alright shut down the system for the first test.

  5. Install a WOL-Software & start the target system remotely
    Install a WOL-Software on any client you want to use to start-up the target system remotely. I installed wol. Install it from your distros package repository or download it from here. After installing wol try to start the target system remotely for the first time. Please notice that I didn’t provide the targets hostname by using the “-h HOSTNAME” option, because it leads to inconsistent behaviour. Replace “xx:xx:xx:xx:xx:xx” with the MAC address of your target system:

    $ wol xx:xx:xx:xx:xx:xx

    If everything went well the target system should be starting. In case you are not in the same local network as the target you have to also provide the port number and the external IP or Hostname of the target. Please take a look at the wol man pages for more details:

    $ wol -p PORTNUM -i EXTERNAL_IP_OF_TARGET xx:xx:xx:xx:xx:xx
  6. Make the changes to the drivers settings persistent
    You may have noticed that the Wake-on-LAN functionality only workes the first time. That’s because the driver resets the “Wake-on” option after each start of the system. In order to be able to always use wake on LAN, you have to set the drivers state every time the system boots back to “g”. Basically you just need to automatically execute the command from step 4) whenever your system starts up. For this purpose you may use any way that’s common or recommended in your Linux distro. In my case using a udev rule didn’t work and strangely with Systemd it only worked sometimes, but in the end a cronjob did the trick:
    Create a new crontab for root like this

    $ sudo crontab -e

    an editor will open and insert this line:

    @reboot /usr/bin/ethtool -s eth0 wol g
  7. From now on the drivers state should be set to “g” on each boot and you should be able to always use wake on LAN.

    Legal notice: image from wikimedia, released into the public domain


About M0nk3ym0nk3y

M0nk3ym0nk3y is one of the three LinuxM0nk3ys from Linux M0nk3ys @ WordPress Linux M0nk3ys @ YouTube Linux M0nk3ys @ Twitter

Posted on March 23, 2014, in Configure, Install, Network and tagged , , , , , , , , , , , , , , , , , , , . Bookmark the permalink. 2 Comments.

  1. great post! it worked like a charm! thank you 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: