SOLVED Enable WOL

soulfire30

Cadet
Joined
Oct 8, 2021
Messages
3
How enable WOL in TrueNas SCALE, i tried add options wol, wol_ucast, wol_mcast, wol_magic in network interfaces but still not working.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
Just confirming this is solved??
Does it survive a software update?
 

Darkyere

Cadet
Joined
Feb 19, 2022
Messages
4
I can confirm that after an software update,
the WoL function is no longer active

I had done it like this

Code:
# First one has to know the interface of the Ethernet

    ifconfig

# Etc.
    enp8s0

----

# Add an interface config file /etc/network/interfaces.d/eth0
# Make sure to change the filename <eth0> to etc. "enp8s0" or similar as from the result above

auto eth0
iface eth0 inet dhcp
    ethernet-wol g

# Change it accordingly

auto enp8s0
iface enp8s0 inet dhcp
    ethernet-wol g

----

# ReBoot
# and it should be in effect


----

# The file in

/etc/network/interfaces.d/enp8s0

# Was missing and had to redo it again.

Just if anyone ellse like me updated recently this has to be redone in what ever way it was set up before.
This was merely mean as an example/guidance.

Hope it was helpfull

Best regards
 

jeti

Cadet
Joined
Apr 7, 2022
Messages
9
this helped me activating WOL, is there a plan to make it persistent over Updates?
 

Darkyere

Cadet
Joined
Feb 19, 2022
Messages
4
As of TrueNAS SCALE 22.02.2 the previous method no longer works.

If have tried with the ifupdown method described in my previous port.
Systemd network mode
and network manager isnt even installed.

On the other hand i used a scripts i usually make use of on Ubuntu and Debian but it requires a little extra editing and commands.

For reference so other people will make use of this method i will post it here.

This is not my own doing i dont remember where on the net i found it, so all thanks goest to guy who fixed it on ubuntu/debian.

Code:
# Enabling WoL in the NIC
# Determining whether the NIC supports WoL
# First, determine which NIC will be used, and then check whether it supports the Magic Packet™ using

sudo ethtool <NIC>


# where <NIC> is the device name of your NIC, e.g. eth0.
# This command will output some information about your the capabilities of your NIC.
# If this output contains a line similar to the following:

Supports Wake-on: <letters>


# where <letters> contains the letter g, the NIC should support the WoL Magic Packet™ method
# (for the other letters look at man ethtool).

# Enabling WoL in the NIC
# To check whether WoL is enabled in the NIC, one could use

->

sudo ethtool <NIC>


# and look for

Wake-on: <letters>


# If <letters> contains g and not d, then Magic Packet™ is enabled.
# However, if <letters> does contain d, WoL needs to be enabled by running the following command:

sudo ethtool -s <NIC> wol g


----

# Non-interactive creation of script which will set the "Wake-on"
# option to "g" which means "Wake on MagicPacket". For the next step (systemd) to work correctly,
# you must have the she-bang line included on the first line of the file.

cat >> /root/wol_fix.sh <<EOF
#!/bin/bash
ethtool -s enp3s0 wol g
EOF


# Set correct permissions for the fix script.

chmod 755 /root/wol_fix.sh


->

# Non-interactive creation of script which will run on boot to run the fixing script.

cat >> /etc/systemd/system/wol_fix.service <<EOF
[Unit]
Description=Fix WakeOnLAN being reset to disabled on shutdown

[Service]
ExecStart=/root/wol_fix.sh
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
EOF

->

# Reload the systemd manager configuration.

systemctl daemon-reload

# start the wol_fix.service

systemctl start wol_fix


# Check if it has enabled wake on g

sudo ethtool <NIC>

# It should now write 

Wake-on: g


# Enable to wol_fix service script.

systemctl enable wol_fix.service


# NOTE: must reboot for the on-boot script to take effect.
# Or you can run the /root/wol_fix.sh script manually this time only before your next shutdown or reboot.

reboot


----

# On next reboot make sure the scripts worked
# Etc.

ethtool <NIC>


# And look for g in Wake-On:

Wake-on: g


Best Regards,
Darkyere
 

Palpebral

Cadet
Joined
Aug 3, 2022
Messages
2
Hi all,

I'm sorry, bit of a beginner on Truenas but I don't have ethtool on my truenas.
I've tried a pkg install but eth tool doesn't exist.

Can you describe me how to install it ? in order to make WOL functionnal

Thanks,
 

papaours

Cadet
Joined
Aug 4, 2022
Messages
1
Hey everyone,

Normally eththool should be installed by default in SCALE.

I used the solution of darkyere, but instead of creating a system service, I added an Init/Shutdown Scripts (System Settings > Advanced).
Hope it will survive next update, but since it's done in the GUI, I have good hopes.

Here is a screen capture of the script I use, and it works well : don't forget to replace the <NIC> with the right interface.
1659682601599.png
 

Palpebral

Cadet
Joined
Aug 3, 2022
Messages
2
Is eththool installed/instalable on a truenascore Version ?

Thanks for you reply, I will try with the script
 

svarga91

Cadet
Joined
Oct 2, 2022
Messages
1
I had to disable Deep Sleep in the BIOS. This powe saving setting turns off the NIC. Now it works.
 

Habetdin

Cadet
Joined
Nov 10, 2022
Messages
1
I've found this thread because I had WoL enabled in BIOS/UEFI, but it didn't work. Enabling WoL inside of TrueNAS using ethtool like this did work:
Code:
ethtool -s enp4s0 wol g

...so I've followed #14 because I'm not sure if manually created/changed files would survive the TrueNAS update.

I used the solution of darkyere, but instead of creating a system service, I added an Init/Shutdown Scripts (System Settings > Advanced).
@papaours Thanks for the idea!
 

hogen

Dabbler
Joined
Dec 30, 2021
Messages
10
I used the solution of darkyere, but instead of creating a system service, I added an Init/Shutdown Scripts (System Settings > Advanced).
This works for me as well, Thank you.

My MSI B450M Mortar built-in Realtek RTL8111H didn't wol without that on TrueNAS-SCALE-22.12.3.3.

BIOS/UEFI
Advanced->Power Management Setup->ErP Ready [Disabled]
Advanced->Wake Up Event Setup->Resume By PCI-E Device [Enabled]
 

jpwiedekopf

Cadet
Joined
Oct 13, 2023
Messages
1
Is eththool installed/instalable on a truenascore Version ?

Thanks for you reply, I will try with the script
For future readers: ethtool is installed by default in TrueNAS SCALE, but the binary is installed in /sbin. This essentially means that if you do not enter sudo ethtool ..., but ethtool ... instead, the shell is going to tell you that the command wasn't found. By prefixing sudo in the shell, and entering the admin user's password, the process gains the privileges required to run ethtool. Apparently, the init tasks are also run with these privileges (I'm guessing as the root user itself), that's why the init tasked worked for you.
 
Last edited by a moderator:

das1996

Dabbler
Joined
May 26, 2020
Messages
25
^^It's curious; these shenanigans are not needed when using an intel nic. Only when using realtek (inc. their rtl8125) is this required.

In fact, after adding a rtl8125 to CORE, I was unable to get any wol flag to stick via ifconfig. System would respond to a wol request once after an unplug/replug scenario, but once shutdown from the OS (core), it would not respond to wol.

Machine in question is not the primary nas, rather a replication target that's powered up once a week for the primary nas to upload its snapshots to. Previously, a i219 onboard (or i217, i can't remember) nic was used. Wol worked just fine on it.

Iirc, there's a setting that can be flashed to the intel nics to enable wol by default. I wonder if realtek nics have something similar? For intel it's called "Intel(R) Ethernet Flash Firmware Utility_preboot"

Given the use case, this was a good opportunity to move the replication target to truenas scale. This of course solved the problem with the use of ethtool as indicated in post #13.
 
Top