6/04/2019

linux make WakeOnLan work

1. Check BIOS Settings
 
2. OS Settings


$ sudo ethtool eth0
 Settings for eth0:
 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
 Advertised link modes:  10baseT/Half 10baseT/Full 
                         100baseT/Half 100baseT/Full 
                         1000baseT/Full 
 Advertised pause frame use: No
 Advertised auto-negotiation: Yes
 Speed: 1000Mb/s
 Duplex: Full
 Port: Twisted Pair
 PHYAD: 1
 Transceiver: internal
 Auto-negotiation: on
 MDI-X: on (auto)
 Supports Wake-on: pumbg
 Wake-on: d
 Current message level: 0x00000007 (7)
          drv probe link
 Link detected: yes



Wake-on Modes:
 
p   Wake on PHY activity
u   Wake on unicast messages
m   Wake on multicast messages
b   Wake on broadcast messages
a   Wake on ARP
g   Wake on MagicPacket™
s   Enable SecureOn™ password for MagicPacket™
d   Disable (wake on nothing). This option clears all previous options.
 
 
 
change to "g Wake on MagicPacket™":


$ ethtool -s eth0 wol g


 ---------------------------------------------------------------------------------------
Change permanent:

as "/etc/rc.local" is executed while boot, just put it there:

 
$ sudo nano /etc/rc.local

#!/bin/sh -e 

# rc.local 

# This script is executed at the end of each multiuser runlevel. 
# Make sure that the script will "exit 0" on success or any other 
# value on error. 

# In order to enable or disable this script just change the execution 
# bits. 

sleep 5 
ethtool -s eth0 wol g 
exit 0 

--------------------------------------------------------------------------------------

on ArchLinux i installed wol-systemd from AUR

$ yay -S wol-systemd

 

enable & start the service:

$ systemctl enable wol@eth0

$ systemctl start wol@eth0 

____________________________________________________________________________________

 
what stopped my machine from starting via WOL:


$ sudo nano /etc/default/tlp

or

$ sudo nano /etc/tlp.conf

look for: # Disable wake on LAN: Y/N.
               WOL_DISABLE=Y
change to: WOL_DISABLE=N