Linux下如何实现远程开机
你知道Linux下如何实现远程开机吗?
下面小编就根据Linux实现远程开机的内容为大家详细介绍其实现方法,有兴趣的小伙伴们就跟随小编一起去探讨具体内容吧。
Linux下实现远程开机的条件,要满足以下两条:首先,这个被远程开机的机器必需是在局域网内,并且你知道这台机器的 MAC 地址;其次,你的网卡支持网络唤醒功能,当然,现在大部分网卡都是支持网络唤醒的功能。检查你的网卡是否支持网络唤醒功能,只要在被远程开机的机器上执行 ethtool 命令,查看该机器网卡是否支持网络唤醒功能。
# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g [ 提示: g 表示已启动. d 表示禁用 ]
Current message level: 0×00000001 (1)
Link detected: yes
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g [ 提示: g 表示已启动. d 表示禁用 ]
Current message level: 0×00000001 (1)
Link detected: yes
提示:以上命令,需要拥有root权限,否则会有以下错误:
$ /sbin/ethtool eth0
Settings for eth0:
Cannot get device settings: Operation not permitted
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0×000000ff (255)
Cannot get link status: Operation not permitted
Settings for eth0:
Cannot get device settings: Operation not permitted
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0×000000ff (255)
Cannot get link status: Operation not permitted
如果网络唤醒功能被禁用,则需要用下面的命令启动网络唤醒功能:
# ethtool -s eth0 wol g
安装网络唤醒软件:
# apt-get install wakeonlan
获取远程机器网卡的物理地址:
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:k5:64:A9:68 [ Mac地址 ]
inet addr:192.168.6.56 Bcast:192.168.6.255 Mask:255.255.255.0
inet6 addr: fe80::216:17ff:fe6b:289/64 Scopeink
eth0 Link encap:Ethernet HWaddr 00:16:k5:64:A9:68 [ Mac地址 ]
inet addr:192.168.6.56 Bcast:192.168.6.255 Mask:255.255.255.0
inet6 addr: fe80::216:17ff:fe6b:289/64 Scopeink
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3179855 errors:0 dropped:0 overruns:0 frame:0
TX packets:2170162 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3832534893 (3.5 GB) TX bytes:390304845 (372.2 MB)
Interrupt:17
RX packets:3179855 errors:0 dropped:0 overruns:0 frame:0
TX packets:2170162 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3832534893 (3.5 GB) TX bytes:390304845 (372.2 MB)
Interrupt:17
通过以下命令,实现远程开机:
# wakeonlan 00:16:k5:64:A9:68
# wakeonlan 00:16:k5:64:A9:68
Linux下如何实现远程开机?
其实Linux实现远程开机必须在被远程开机的机器是在局域网内和知道MAC地址和,看完后你是否明白了呢?
速维网络!!!
需要服务器可以扣俺!
tel: 137 1307 8760
需要服务器可以扣俺!
tel: 137 1307 8760