安裝了公司一台機器後才發現, 這個功能有些時候是需要啟動的@@
參考自 https://wiki.debian.org/WakeOnLan
# Enabling WOL
ifupdown
Add an interface config file /etc/network/interfaces.d/eth0 (or modify the global interface config file /etc/network/interfaces):
auto eth0
iface eth0 inet dhcp
ethernet-wol g
Activate it:
sudo reboot
# systemd-networkd
You can check if your network is managed by systemd-networkd by networkctl list command.
Set the WakeOnLan field to one of the available options in the [Link] section of the .link file for the network interfaces you want to use WOL on:
[Link]
WakeOnLan=magic
Beware that only the first .link file is applied and that there is a 99-default.link. The name needs to be lexicographically smaller.
Activate it:
sudo networkctl reload
sudo networkctl reconfigure
# NetworkManager
You can check if your network devices are managed with nmcli d command.
NetworkManager supports WOL since version 1.0.6 and you can enable it from either your desktop network configuration GUI, or the nm-connection-editor GUI from nm-connection-editor, or from the nmcli command-line tool using this command:
$ sudo nmcli c modify "wired1" 802-3-ethernet.wake-on-lan magic
Manual
The ethtool command from the ethtool package can tell the network interface to respond to the magic packet. Replace eth0 with your network interface device name:
$ sudo ethtool -s eth0 wol g