Wake on lan works on windows10 but not centos8

Issues related to applications and software problems and general support
Post Reply
simaqs
Posts: 7
Joined: 2019/09/25 06:10:41

Wake on lan works on windows10 but not centos8

Post by simaqs » 2020/07/08 13:47:01

I recently replaced my router with asus ax86u,I make my PC as NAS with cenos8,it both has win10 and centos8.
I set it can be waked up by my router and my "wakeup on lan" app in win10,but when was use cenos8 and powered off,it can't be waked up by
my router,but it can be waked up by my app on my iphone.
I have set /etc/sysconfig/network-scripts/ifcfg-enp4s0,add 'ETHTOOL_OPTS=”wol g”',and type “ethtool enp4s0",it list
.......Supports Wake-on: g
Wake-on: g
But why I cant't wakeup my pc via router? I can wakeup it by Iphone indicate it was properly setted! I can waked it up by my router when it was
shudown from win10 means my router worked!(sorry for my poor English!)

simaqs
Posts: 7
Joined: 2019/09/25 06:10:41

Re: What's the difference between windows10 and centos8?

Post by simaqs » 2020/07/25 07:03:54

Is there anyone can help me?
If someone have asus router and use the 'wol' to wakeup your centos8 machine,pls tell me how you set your machine!

iwishitwouldwork
Posts: 67
Joined: 2014/02/08 14:56:39

Re: What's the difference between windows10 and centos8? really about wake-on-lan

Post by iwishitwouldwork » 2020/07/26 00:30:50

That's one wacky subject line.

First, see whether your interface supports wake-on-lan (wol hereafter).
You may have to install ethtool. My interface is eno1.

Code: Select all

[root@fs purewol]# ethtool eno1
Settings for eno1:
	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
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: on
	MDI-X: off (auto)
	Supports Wake-on: pumbg
	Wake-on: g
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes
You care about the lines that say "Wake-on". Man ethtool to see
what they mean in detail.

The device may claim to support wol but not, in fact. And it may
claim to support wol but then "forget" that it does after a reboot.
My limited experience with it says that added-in cards may say they do,
but don't. Built-in (ie, on the motherboard) devices are more likely to
actually work.

Okay, so, your device forgets that it works with wol. I get it to remember
by putting in a startup service.

Code: Select all

[root@fs purewol]# more wol.service 
#	/etc/systemd/system/	wol.service
[Unit]
Description=Keep wol turned on.  (sigh)
After=network.target

[Service]
Type=simple
ExecStart=/opt/bin/keepwol
TimeoutStartSec=0

[Install]
WantedBy=default.target
keepwol:

Code: Select all

[snip]
LIST=`ls /sys/class/net`

for ii in $LIST
do
	if [ "$ii" != "lo" ] ; then
		/usr/sbin/ethtool  --change $ii wol g
	fi
done
Finally, use "ether-wake" to get a machine to power up.
See the man page for that.

None of this uses the router.

scottro
Forum Moderator
Posts: 2456
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: Wake on lan works on windows10 but not centos8

Post by scottro » 2020/07/26 13:13:30

I've changed the subject line to one that better describes the issue. People on these forums are often very busy full time sysadmins and will see a subject line like what's the difference between windows10 and CentOS8, and not bother to look at the post. Hopefully, the new subject line will get more looks from people who are familiar with it.
New users should check the FAQ and Read Me First pages

mathog
Posts: 211
Joined: 2008/07/09 23:52:06

Re: Wake on lan works on windows10 but not centos8

Post by mathog » 2020/07/27 17:41:22

simaqs wrote:
2020/07/08 13:47:01
it can't be waked up by my router,but it can be waked up by my app on my iphone.
Install wireshark or some other equivalent and log what your iphone and router are actually sending. Your machine may WOL from a directed packet but not from a broadcast one, and it could be that the phone is sending the former and your router the latter. The result would be very mysterious if they are both sending the same thing.

I have encountered machines which "support" WOL but there is no way to configure it as "on" in the BIOS so that it actually only works after a power down, not on recovery from a power failure or when the machine is first plugged in, or the power strip turned on. That can lead to confusing results if one unwittingly tests for WOL in one OS after plugging in and in the other OS after a shutdown.

You didn't say why you need WOL to work. If it is for an unattended server other options which would allow you to regain control remotely would include setting an rtcwake event every day (so it will restart from an unexpected shutdown), boot on power on (so it will start whenever power is newly applied), or something like Dell's iDRAC (for in band or out of band system management).

This is a bit Windows specific, but most of what it says applies to Linux too:

https://www.dell.com/support/article/en ... es?lang=en

see especially item 9 in the check list.

One last thing, find the service or script which is turning off the network during shutdown and be sure that it is not resetting the network interface, and in so doing clearing the WOL setting you made earlier.

simaqs
Posts: 7
Joined: 2019/09/25 06:10:41

Re: Wake on lan works on windows10 but not centos8

Post by simaqs » 2020/07/28 06:56:56

Thanks everybody for help me!
I wanted to listen the NIC and find the difference between iPhone app and the router,but I have not installed x-window yet,maybe I should install x-window first!

simaqs
Posts: 7
Joined: 2019/09/25 06:10:41

Re: Wake on lan works on windows10 but not centos8

Post by simaqs » 2020/07/28 08:47:52

Now,I look into my app and found I can wake up my machine when set “ use broadcast” on,which means the signal was sent to 192.168.1.255(broadcast),but my router sent it to 192.168.1.x,but how can I fix it?

lightman47
Posts: 1160
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: Wake on lan works on windows10 but not centos8

Post by lightman47 » 2020/07/28 16:23:40

it actually only works after a power down, not on recovery from a power failure or when the machine is first plugged in, or the power strip turned on.
FYI - this is how it works an ALL my machines. Power outages/power buttons/unplugged cords always require me to power-button the machine on the next time. For some reason, the portion of the network card that 'listens' for the magic packet is not powered-on after the actual power has been removed (so it can't listen).

The only machine I ever had that DID listen after a power outage was my now gone HP DL380 G5.
Remember - importing/building packages will likely "byte you in the butt" come update time, long after you'd forgotten you did that! Use repos whenever possible.

mathog
Posts: 211
Joined: 2008/07/09 23:52:06

Re: Wake on lan works on windows10 but not centos8

Post by mathog » 2020/07/28 17:07:18

lightman47 wrote:
2020/07/28 16:23:40
it actually only works after a power down, not on recovery from a power failure or when the machine is first plugged in, or the power strip turned on.
The only machine I ever had that DID listen after a power outage was my now gone HP DL380 G5.
Server class machines can often be set up to work with WOL from initial application of power. Desktop machines, not so much.

I recently ran into a sort of converse problem. There was a scheduled cooling outage for our machine room so all the machines needed to shut down before that, with rtc wake set to get them back up again at the appointed time. But one server was attached to an APC UPS via a USB cable, and the signals from the UPS (this was just a normal shutdown, not a power loss even, so the UPS was still live) woke it back up shortly after it shut down. Apparently the BIOS was set to wake on USB.

This makes me think that attaching a USB to Ethernet dongle would be an inexpensive solution to obtain WOL from power applied capability. For instance, based on the quoted specs, this one might work:

https://www.amazon.com/StarTech-com-USB ... B0095EFXMC

Hopefully these can only respond to directed WOL packets and not broadcast ones, otherwise it will probably wake the machine based on typical network traffic as soon as power is reapplied, which is hardly any different to setting its power on state to "on".

Post Reply

Return to “CentOS 8 - General Support”