[SOLVED] Leave NIC in low power state for wol

Kernels, Network, and Services configuration
Post Reply
Message
Author
eiopago47
Posts: 4
Joined: 2017-06-19 18:35

[SOLVED] Leave NIC in low power state for wol

#1 Post by eiopago47 »

Hi,

I'm struggling to make a new Stretch work station wake on lan.
The bios supports it and it's obviously been enabled.
This is part of the output of ethtool:

Supports Wake-on: g
Wake-on: g

It looks ok and the g shows at each reboot (I guess it takes that directly from the bios) but still, after powering off, wol does not work (no lights on the nic).
I have tried ethtool -s enp5s0 wol g before shutting down and still no luck.

Searching on google I read that for non systemd debians you could have netdown=no in /etc/init.d/halt to leave the nic in low power state and ready for wol.
This is also possible in Jessie but Stretch does not seem to have halt in that directory.
Is there any way I could avoid shutting down the nic completely when powering off? Any equivalent to /etc/init.d/halt?
Last edited by eiopago47 on 2017-07-22 14:18, edited 1 time in total.

eiopago47
Posts: 4
Joined: 2017-06-19 18:35

Re: Leave NIC in low power state for wol

#2 Post by eiopago47 »

I have found the solution here:

https://lists.debian.org/debian-user/20 ... 00241.html

Basically, installing nictools-pci did the trick (learn how to use the tool http://www.thinkwiki.org/wiki/WakeOnLAN).

All I had to do was to create a service which would call the script below before each poweroff:

Code: Select all

##!/bin/sh
# Unmount network file systems
umount -a -f -t cifs
umount -a -f -t nfs
# Unload the driver
rmmod tg3
sleep 0.5
# Reload the driver
modprobe tg3
sleep 0.5
# Put network card in appropriate state for WOL:
pci-config -B 5 -# 1 -S
sleep 0.5

P.S. the script is not mine but I forgot where I copied it from

Post Reply