Ubuntu Linux:为服务器安装Wake On Lan客户端

时间:2020-01-09 10:45:38  来源:igfitidea点击:

如何在Ubuntu Linux桌面下的lan客户端上安装唤醒,以唤醒Unix或者基于Linux的服务器?
您需要安装wakeonlanperl脚本来唤醒计算机或者服务器。
该实用程序将魔术包发送到启用了局域网唤醒功能的以太网适配器和母板。
您需要使用它来打开PC或者服务器。
请注意,只有在BIOS中启用了WOL功能且主板已启用的NIC时,这才起作用。

Ubuntu唤醒局域网客户端安装

打开一个终端并输入以下命令:

$ sudo apt-get install wakeonlan

输出示例:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  wakeonlan
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.4 kB of archives.
After this operation, 73.7 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu/ precise/main wakeonlan all 0.41-10 [11.4 kB]
Fetched 11.4 kB in 0s (24.8 kB/s)    
Selecting previously unselected package wakeonlan.
(Reading database ... 193608 files and directories currently installed.)
Unpacking wakeonlan (from .../wakeonlan_0.41-10_all.deb) ...
Processing triggers for man-db ...
Setting up wakeonlan (0.41-10) ...

如何使用wakeonlan客户端?

语法是

wakeonlan server-mac-address-here
wakeonlan [options] server-mac-address-here

例子

执行以下命令以Mac地址为00:08:9b:c4:30:30唤醒名为nas01的nas服务器,执行:

$ wakeonlan 00:08:9b:c4:30:30

输出示例:

Sending magic packet to 255.255.255.255:9 with 00:08:9b:c4:30:30

要使用子网广播地址:

$ wakeonlan -i 192.168.1.255 00:08:9b:c4:30:30

您可以使用另一个目标端口:

$ wakeonlan -i 192.168.1.255 -p 2345 00:08:9b:c4:30:30

最后,您可以使用文件作为硬件和IP地址的来源:

$ wakeonlan -f ~$HOME/.admin-data/racks/dc05.floor03.wol