WOL persistence configuration

Time:2021-5-2
  1. Ensure that the BIOS and NIC support WOL wake-up, and turn off the low-power mode
  2. This command is only tested on Ubuntu 20.04 LTS, and the rest of the distributions are the same. Please test yourself

Reference link
https://www.techrepublic.com/article/how-to-enable-wake-on-lan-in-ubuntu-server-18-04/
https://help.ubuntu.com/community/WakeOnLan#External_Links

WOL open Settings

Shado apt get install ethtool
➜~ IP a # query network status and other information...
➜~ sudo ethtool - s enp1s0 WOL g # enable WOL function
➜~ sudo ethtool enp1s0 # whether the query is enabled successfully        
Settings for enp1s0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	Link partner advertised pause frame use: Symmetric
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	Speed: 100Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: pumbg
	Wake on: G # flag bit is g, that is, WOL has been turned on, and D is the opposite
	Current message level: 0x00000033 (51)
			       drv probe ifdown ifup
	Link detected: yes

WOL persistent setting (to ensure that the WOL function of the network card is still turned on after restarting)

Create a WOL boot process

sudo nano /etc/systemd/system/wol.service

Write content

[Unit]
Description=Configure Wake On LAN

[Service]
Type=oneshot
ExecStart=/sbin/ethtool -s INTERFACE wol g

[Install]
WantedBy=basic.target

Make SYSTEMd aware of the new WOL script

sudo systemctl daemon-reload

Enable WOL script

sudo systemctl enable wol.service

Enable WOL scripts

sudo systemctl start wol.service

finish

Recommended Today

Large scale distributed storage system: Principle Analysis and architecture practice.pdf

Focus on “Java back end technology stack” Reply to “interview” for full interview information Distributed storage system, which stores data in multiple independent devices. Traditional network storage system uses centralized storage server to store all data. Storage server becomes the bottleneck of system performance and the focus of reliability and security, which can not meet […]