How to enable Wake On LAN (WOL) on ASRock motherboard in Linux Mint

Written by - 0 comments

Published on - last updated on April 27th 2022 - Listed in Hardware Linux


Wake on LAN (WOL) is a technology which allows to boot a computer from the network interface. A "magic packet" is sent from another machine in the same network (broadcast range) and is received by the connected network card (NIC). Even if the computer is powered down, the NIC is still able to receive network packets - if enabled in the BIOS/UEFI.

This article shows how to enable Wake on LAN on a ASRock motherboard. More precisely on a ASRock B550M Pro4, but the same procedure should apply to most ASRock motherboards.

Enable Wake on LAN in UEFI BIOS

First boot into the motherboards BIOS/UEFI Setup. This can be done by pressing F2 or DEL during early boot phase.

Once in UEFI, select "Advanced", then open the "ACPI Configuration":

Advanced settings in ASRock UEFI

The Wake on LAN relevant setting is called "PCIE Devices Power On", which may sound confusing but that's actually the setting responsible to enable WoL:

Enable Wake on LAN in ASRock UEFI

Once you've set "PCIE Devices Power On" to enabled, save the settings and exit UEFI.

Enable Wake on LAN in Linux

But that's not enough (yet) to accept Wake on LAN magic packets. The network card also needs to be told that it should listen to magic packets. In Linux this can be achieved with the ethtool command.

The full output of ethtool run against the network interface (here enp3s0) shows the card's capabilities:

ckadm@mintp ~ $ sudo ethtool enp3s0
Settings for enp3s0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            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/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
                                         1000baseT/Full
    Link partner advertised pause frame use: Symmetric
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 1000Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: Unknown
    Supports Wake-on: pumbg
    Wake-on: d
    Link detected: yes

To see the Wake on LAN specific settings, use:

ckadm@mintp ~ $ sudo ethtool enp3s0 | grep Wake
    Supports Wake-on: pumbg
    Wake-on: d

This shows what kind of Wake-on options this card supports: "pumbg". However right now the current setting (Wake-on) is set to d (disabled).

To enable Wake-on on this card, set the option to "g" (Wake on MagicPacket):

ckadm@mintp ~ $ sudo ethtool -s enp3s0 wol g

Verify that the setting was saved:

ckadm@mintp ~ $ sudo ethtool enp3s0 | grep Wake
    Supports Wake-on: pumbg
    Wake-on: g

Now run the command ip a and note down the physical (MAC) address of the card:

ckadm@mintp ~ $ ip a | grep ether
    link/ether 70:85:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff

Send a Wake on LAN magic packet

Any other computer (or even mobile phone) in the same network can now send such a magic packet to wake up and start up the computer. 

From another Linux machine you can use the wakeonlan command by using the MAC address noted down before:

ck@anothermachine ~ $ sudo apt-get install wakeonlan
ckadm@mintp ~ $ wakeonlan 70:85:xx:xx:xx:xx

VoilĂ , your machine should now boot up. At least mine did.

NIC config is reset after boot

Note that the Wake-On setting is most likely reset after a reboot. You could add the ethtool command above into /etc/rc.local to execute this command during start time. Note that in newer versions rc.local is by default disabled. See /etc/rc.local does not exist anymore, does it still work? for more information.

Another way is to add this into the network configuration, e.g. /etc/network/interfaces as "up" command. But Linux Mint uses /etc/NetworkManager by default.

The easiest way is to search for "Network" in the Linux Mint search, then select "Advanced Network Configuration".

Network options in Linux Mint

Then select and edit your primary network connection using the physical network card, probably named (by default) "Wired connection 1":

Configure network adapter in Linux Mint

Disable the "Default" option and instead select the "Magic" option. 

This will create or modify the config file under /etc/NetworkManager. Or you can skip the configuration in the GUI and manually add the wake-on-lan setting into the relevant Network Manager config file in the [ethernet] section:

ck@mintp ~ $ sudo cat /etc/NetworkManager/system-connections/Wired\ connection\ 1.nmconnection
[connection]
id=Wired connection 1
uuid=bf56942c-7006-3ae9-815f-aa399255d043
type=ethernet
autoconnect-priority=-999
interface-name=enp3s0
permissions=
timestamp=1651036665

[ethernet]

mac-address-blacklist=
wake-on-lan=64

[ipv4]
dns-search=
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
ip6-privacy=0
method=auto

[proxy]

The value "64" represents the MagicPacket configuration.

The next time, "Wired Connection 1" is (re-) connected, the Wake-on option will be set on the network interface.


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.