# 远程开机 ## 一、查看可用网卡 ```bash ifconfig #有些网卡为eth0,有些为eno1 ``` ## 二、查看网卡信息 ```bash ethtool eth0 #eth0作为网卡,如果 wake-on 一项值为 d,表示禁用;wake on lan值为 g,表示启用 wake on lan #如果机器禁用了wake on lan,用命令启用 ethtool -s eth0 wol g #################################################### Settings for eno1: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Speed: 100Mb/s Duplex: Full Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on MDI-X: off (auto) Supports Wake-on: pumbg Wake-on: g Current message level: 0x00000007 (7) drv probe link Link detected: yes ``` ## 三、安装wakeonlan ```bash apt-get install wakeonlan ``` ## 四、获取MAC地址 ```bash ifconfig #MAC地址为f0:2f:74:af:eb:e3 ############################################## eno1: flags=4163 mtu 1500 inet 172.16.33.106 netmask 255.255.255.0 broadcast 172.16.33.255 inet6 fe80::f22f:74ff:feaf:ebe3 prefixlen 64 scopeid 0x20 ether f0:2f:74:af:eb:e3 txqueuelen 1000 (Ethernet) RX packets 12889 bytes 10644443 (10.6 MB) RX errors 0 dropped 773 overruns 0 frame 0 TX packets 3918 bytes 326191 (326.1 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 16 memory 0x92100000-92120000 ############################################### ``` ## 五、远程开机 ```bash wakeonlan f0:2f:74:af:eb:e3 ```