搭建Linux下的自动唤醒功能(原创)
作者: 曲文庆 日期: 2008-10-31 11:43
一般办公室的网关都是24小时开着的,有时候需要远程启动办公室的机器获取些资料,使用这个功能就比较方便了。
首先设置个人机器网卡可以网络唤醒(在BIOS里设置,现在的机器一般都支持这个功能)
网关服务器设置:
#wget ftp://ftp.scyld.com/pub/diag/ether-wake.c
#gcc -O -Wall -o ether-wake ether-wake.c
这步估计会提示些错误信息,先不管它,看看目录下是否生成ether-wake文件了
ok,我这里生成了
#./ether-wake -u
usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55
This program generates and transmits a Wake-On-LAN (WOL)
"Magic Packet", used for restarting machines that have been
soft-powered-down (ACPI D3-warm state).
It currently generates the standard AMD Magic Packet format, with
an optional password appended.
The single required parameter is the Ethernet MAC (station) address
of the machine to wake or a host ID with known NSS 'ethers' entry.
The MAC address may be found with the 'arp' program while the target
machine is awake.
Options:
-b Send wake-up packet to the broadcast address.
-D Increase the debug level.
-i ifname Use interface IFNAME instead of the default 'eth0'.
-p <pw> Append the four or six byte password PW to the packet.
A password is only required for a few adapter types.
The password may be specified in ethernet hex format
or dotted decimal (Internet address)
-p 00:22:44:66:88:aa
-p 192.168.1.1
将需要的ip mac对应列表保存在网关服务器上,需要的时候,远程登陆到网关服务器执行
#./ether-wake -i eth0 -p 需要启动机器的MAC (eth0是内网网卡)
过一会,机器就启动了。
当然了,如果想远程控制办公室机器,还要在个人机器上装远程控制软件,网关服务器上开通相关策略,由于这些内容不属于本文讨论范围,就略过了。
linux 双网卡绑定(bonding)实现负载均衡或故障转移 (2010-05-13 16:11)
Windows 7 安装、运行 Sniffer 4.7.5 sp5 (2010-04-30 08:55)
yum更新和rpm安装包问题(rpmdb: PANIC: Invalid argument) (2010-04-28 11:10)
Nginx配置PHP的一个关键注意点 (2009-02-02 17:20)
今冬第一雪 (2008-12-21 16:13)
油价终于下调了 (2008-12-19 09:25)
SSH连接慢问题解决 (2008-12-02 16:37)
Linux下的Memcache安装 (2008-12-02 16:26)
搭建Lighttpd的SSL模块(原创) (2008-11-05 16:32)