jump to navigation

Enable WOL on Centos 5.5 — (Wake up on Lan) November 20, 2010

Posted by Tournas Dimitrios in Linux.

Quite simply, WOL is a technology that allows a computer that is turned off to be remotely turned on.  While there are a number of different protocols for implementing WOL, the most popular is the ‘Magic Packet’ tm technique.WOL-enabled computers must have a network adapter installed in them that supports one or more remote wake up protocols.  The general technique used by WOL-enabled network cards is that even when powered off, the computer’s network card still receives a small amount of power to enable the card to ‘listen’ for a special signal on the network to wake up.  At that point, it instructs the computer to turn itself on.  The key to implement WOL is to know the remote computer’s (the one to be awakened) MAC address.  The MAC address is used since the computer is OFF, and any tcp, registry, etc. services are not available.

To enable Wake up On Lan within Centos 5.5 you will need ethtool and a WOL client. If ethtool is not already installed on your Centos system use  yum install ethtool and  yum install net-tools (WOL client) .

This will put the ethtool program into /usr/sbin . If you are using a windows client to turn on the Centos machine you can use WOL client.

If you are waking the Centos box from another linux machine you could use a command line tool e.g.

/usr/sbin/ether-wake MAC-Address

For both wake up tools the MAC address of the Centos box will be needed, this can be obtained by issuing

ifconfig eth0 |grep HW | awk ‘{print $5}’

By default Centos does not enable WOL, it is necessary to modify the interface shutdown script to achieve this.

Modify the file /etc/sysconfig/network-scripts/ifup-post , add the following at the end of the file BEFORE the exit 0  /usr/sbin/ethtool -s eth0 wol g

This configuration will force eth0 to enable wol during the shutdown process instead of powering the interface off completely.

You should now be able to power down the Centos using                        shutdown -h now and restart it using one of your WOL client tools.

A lot of packages supports the WOL client functionality , my previous demonstration uses the ” ether-wake ”  command (net-tools rpm package ) . An alternative client is the ” wakeonlan ” , the rpm package that contains this command is :  wakeonlan-0.41-0.fdr.1.noarch.rpm . You have to download this package manually vs .

#  wget  http://gsd.di.uminho.pt/jpo/software/wakeonlan/downloads/wakeonlan-0.41-0.fdr.1.noarch.rpm

#   rpm  -Uvh wakeonlan-0.41-0.fdr.1.noarch.rpm

#   wakeonlan  **:**:**:**:**:** (MAC-address)

Read more :



1. David - January 11, 2011

Good job!! This’ been a really useful information!

tournasdimitrios1 - January 11, 2011

I’m glad you like it .

2. Sam - May 13, 2011

This is very helpful info. We have a linux server that needs starting up every day in an office full of Macs (which all have autostartup). I couldn’t get WoL working, despite the PC’s BIOS saying it was enabled. The ‘ifup-post’ edit has sorted it out.
Many thanks for posting.

tournasdimitrios1 - May 13, 2011

You are welcome

3. djtecha - October 26, 2011

Nice, but you do have a typo, tab complete would avoid this issue but, the path is off:

/usr/sbib/ethtool -s eth0 wol g

Should be
/usr/sbin/ethtool -s eth0 wol g

tournasdimitrios1 - October 26, 2011

Thanks for your feedback , the typo is corrected .

Leave a Reply

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

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s