Thursday, June 27, 2013

Wake On Lan (WOL)

Wake on lan is a system which receives a special packet from the network to turn on a machine. Let's begin installing it on the server.

apt-get install wakeonlan

It is prettty easy, first you need to be sure that it is enabled in your bios, since every bios is different, it is your work to find how to do this.

Now the system must have enable WOL as well. Install ethtool on the client

apt-get install ethtool


and run

ethtool eth0

if we see the line

Supports Wake-on: pumbg

WOL is supported by your ethernet card, but for new machines this is alwatys the case. Now if you see the line 

Wake-on: d

WOL is disable. Enable it with

ethtool -s eth0 wol g

Since WOL uses the MAC address to wake a machine you should create the file /etc/ethers with the pair MAC/hostname in the server. Since I have already done something similar for /etc/hosts I used this line to get that done

touch /etc/ethers && for i in $(seq 0 1 12); do arp wn$i | grep | ether | awk '{print $3 " " $1}' >> /etc/ethers

and now for a turned off machine you can run

wakeonlan wn0

1 comment:

  1. It is amazing that a packet will enable a system at remote place. The authentication level is very high for this operation to svae it from misuse.

    Thanks
    Silvester Norman

    Change Mac Address

    ReplyDelete