[步骤] Wake On Lan (WOL) 功能的开启 ( Rocky Linux & RHEL 版)

步骤一:在 BIOS 开启 Wake On Lan (WOL) 功能

(步骤略)

步骤二:在系统开启 Wake On Lan (WOL) 功能

2.1 确保 net-tools 已经安装

# yum install net-tools

2.2 查看网卡的 Wake On Lan (WOL) 功能状态

2.2.1 Wake On Lan (WOL) 功能状态列表

1) p, Wake on PHY activity
2) u, Wake on unicast messages
3) m, Wake on multicast messages
4) b, Wake on broadcast messages
5) a, Wake on ARP
6) g, Wake on MagicPacket™
7) s, Enable SecureOn™ password for MagicPacket™
8) d, Disable (wake on nothing). This option clears all previous options

2.2.2 查看网卡的 Wake On Lan (WOL) 功能状态
# ethtool enp16s0
Settings for enp16s0:
	Supported ports: [ TP ]
	Supported link modes:   10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	Supported pause frame use: Symmetric
	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: Symmetric
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	Auto-negotiation: on
	Port: Twisted Pair
	PHYAD: 1
	Transceiver: internal
	MDI-X: off (auto)
	Supports Wake-on: pumbg
	Wake-on: g
        Current message level: 0x00000007 (7)
                               drv probe link
	Link detected: yes


补充:
1) 这里以使用 enp16s0 网卡开启 Wake On Lan (WOL) 功能为例
2) 这里的 Wake On Lan (WOL) 功能状态是 g

2.3 临时开启 Wake On Lan (WOL) 功能

# ethtool -s enp16s0 wol p

(补充:这里以给 enp16s0 网卡开启 Wake On Lan (WOL) 功能为例)

2.4 永久开启 Wake On Lan (WOL) 功能

# vi /etc/sysconfig/network-scripts/ifcfg-enp16s0

添加以下内容:

......
ETHTOOL_OPTS="-s ${DEVICE} wol p"

(补充:这里以给 enp16s0 网卡开启 Wake On Lan (WOL) 功能为例)