Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:linux-tutorials:enable-wol-persistent [2024/02/07 15:41] – created Zyzonixlinux:linux-tutorials:enable-wol-persistent [2024/02/07 16:05] (current) – [Enable automatically at boot] Zyzonix
Line 1: Line 1:
 ===== Enable Wake-on-LAN persistent ===== ===== Enable Wake-on-LAN persistent =====
  
 +<callout type="info" icon="true">This guide was tested on Ubuntu 22 and Debian 11/12.</callout>
  
 +==== Check current setting and enable manually ====
 +Firstly find out the interface on which WoL should be enabled. Therefore use ''ifconfig'' that is shipped with the ''net-tools''-package on Debian/Ubuntu:
 +<code bash>ifconfig</code>
 +
 +Your output may look like this:
 +<code bash>
 +enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
 +        inet 192.168.0.2  netmask 255.255.255.0  broadcast 192.168.0.255
 +        inet6 fe80::ed26:e33:5d38:2468  prefixlen 64  scopeid 0x20<link>
 +        ether xx:xx:xx:xx:xx:xx  txqueuelen 1000  (Ethernet)
 +        RX packets 138808  bytes 178312866 (178.3 MB)
 +        RX errors 0  dropped 3324  overruns 0  frame 0
 +        TX packets 70435  bytes 59140948 (59.1 MB)
 +        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 +
 +lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
 + [...]
 +
 +wlp2s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
 +        ether xx:xx:xx:xx:xx:xx  txqueuelen 1000  (Ethernet)
 +        RX packets 0  bytes 0 (0.0 B)
 +        RX errors 0  dropped 0  overruns 0  frame 0
 +        TX packets 0  bytes 0 (0.0 B)
 +        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 +</code>
 +
 +Then check the current Wake-on-LAN-state with ''ethtool''. (Package to install has the same name):
 +<code bash>sudo apt install ethtool</code>
 +<code bash>ethtool <interface></code>
 +Replace ''<interface>'' for examle with ''enp1s0'', if this is the ID of your interface.
 +
 +
 +The output may now look like this:
 +++++ Show/Hide |
 +<code bash>
 +Settings for enp1s0:
 +        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: No
 +        Link partner advertised auto-negotiation: Yes
 +        Link partner advertised FEC modes: Not reported
 +        Speed: 1000Mb/s
 +        Duplex: Full
 +        Auto-negotiation: on
 +        master-slave cfg: preferred slave
 +        master-slave status: slave
 +        Port: Twisted Pair
 +        PHYAD: 0
 +        Transceiver: external
 +        MDI-X: Unknown
 +        Supports Wake-on: pumbg
 +        Wake-on: d
 +        Link detected: yes
 +</code>
 +++++
 +
 +Important are the following lines:
 +<code bash>
 +        [...]
 +        Supports Wake-on: pumbg
 +        Wake-on: d
 + [...]
 +</code>
 +If the line ''Supports Wake-on:'' contains **''g''**, then Wake-on-LAN ist supported. 
 +
 +If the line ''Wake-on:'' already says ''Wake-on: g'', then WoL is already enabled, if not, you can enable it with:
 +<code bash>sudo ethtool -s <interface> wol g</code>
 +
 +==== Enable automatically at boot ====
 +
 +If not enabled in BIOS WoL has to be enabled before shutting down. This can be done by a system service:
 +
 +Firstly create the service file:
 +<code bash>sudo nano /etc/systemd/system/wol-enable.service</code>
 +And add this content: 
 +<code bash>
 +[Unit]
 +Description=Configure Wake-up on LAN
 +After=network-online.target
 +
 +[Service]
 +Type=oneshot
 +ExecStart=/sbin/ethtool -s <interface> wol g
 +
 +[Install]
 +WantedBy=basic.target
 +</code>
 +Remind to change the ''<interface>''.
 +
 +Then save the file and enable the service with:
 +<code bash>sudo systemctl enable wol-enable.service</code>
 +
 +// Sourced from [[https://wiki.ubuntuusers.de/Wake_on_LAN/|wiki.ubuntuusers.de]]//
  • linux/linux-tutorials/enable-wol-persistent.txt
  • Last modified: 2024/02/07 16:05
  • by Zyzonix