分享

唤醒关闭的机器

 linchq 2011-04-20

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

Posted by tournasdimitrios1 in Linux.
trackback

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/sbib/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./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)

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多