被唤醒PC(ubuntu)配置
进入BIOS配置, 找到PXE相关的选项,将其enable
检查PC是否支持WOL, 输入命令
sudo ethtool -s eth0 wol g
然后再输入命令
sudo ethtool eth0 | grep Wake-on
如果结果包含 Wake-on: g, 表示你的以太网卡支持WOL
-
现在,让我们设置开机时自动配置WOL
vi /etc/network/interfaces
新增下面的内容(请按需修改)
iface eth0:1 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254
post-up /sbin/ethtool -s eth0 wol g
post-down /sbin/ethtool -s eth0 wol g
-
查询eth MAC address
sudo ifconfig eth0 |grep HWaddr
记录下HWaddr,类似下面的内容:
HWaddr 43:37:e8:ae:3f:fa
发送唤醒命令的PC配置
安装 etherwake
sudo apt-get install etherwake
唤醒PC(根据实际的MAC Address修改)
wakeonlan 43:37:e8:ae:3f:fa
or
etherwake 43:37:e8:ae:3f:fa