How to wake on lan with Fedora?

I’ve been trying to wake-on-lan my Fedora desktop, and haven’t succeeded, what am I doing wrong?

Setup

I have a mini PC, and a desktop, both Fedora 44. From my mini PC, I tried:

$ sudo ether-wake -i enp2s0 <desktop-ethernet-mac-address>

The mini PC and the desktop are connected via network switch in an isolated subnet.

I don’t get any errors, but neither does my desktop wakeup.

Is the machine configured to WoL in the BIOS?

Yes, unless I misunderstood the BIOS menus.

# ethtool <interface> | grep -i wake
Supports Wake-on: pumbg
	Wake-on: g          <- wol enabled by magic packet> 

arm wol on interface

# ethtool -s <interface> wol g 

see man ethtool for details

Obvious questions, which I presume you’ve already worked thorugh:

  • Is that the correct interface?
  • Does the target machine’s NIC actually support WoL?
  • Does it wake from Suspend and fails to awake from a full shutdown?
  • Does a tcpdump running on the target actually see the WoL packet arrive?

It was on d, after running the second command it is g now. I didn’t know this was necessary.

I’ll try again and report back.

Still very helpful to be reminded of them!

There is only one on the target, and the 2nd port on the source is not connected, but I’ve double checked (using ip addr), the device names and mac address is correct

Yes

$ sudo ethtool enp7s0 | grep -i wake
	Supports Wake-on: pumbg
	Wake-on: g

I don’t suspend my desktop, on or shutdown. I was trying to wake it up when it was completely shutdown.

This was not obvious to me, now that you mention it, seems obvious to check! However I don’t know which tool I can use to check this? I’m a networking n00b :face_with_tongue:

I asked about the does it WoL from suspend versus WoL from shutdown to see if the system/BIOS actually does WoL at all.

sudo tcpdump -i enpXsY -X

Then send the packet.

A WoL magic packet contains FF FF FF FF FF FF followed by the destination MAC repeated 16 (I think!) times.

Thanks! That worked :slight_smile:

Okay, I’ll try this out (for my learning). Thanks again :slight_smile:

I’m going to add a few things here, in spite of this being marked as ‘solved’.

Your statement about not receiving an error: A magic packet is a UDP packet, so it’s not guaranteed. There will never be an error.

If you want to have the ability to wake this system remotely, you’ll need to open the port you’re using on your router so incoming packets arrive at the PC. This is sometimes dubious, as not all routers will support wake on lan remotely. I used to review items for Newegg years ago, and they had me to a LOT of routers (which wasn’t always fun). The number of devices that would support remote wake on lan was actually rather small. At the time, I was using DLink hardware, but later stuff from them disabled the ability to do WOL. Netgear was my new choice which is what I still use today.

Not all ISPs support wake on lan. For instance, on Verizon,your IP address changes so often that WOL isn’t possible. Comcast is more or less static, in spite of it really not being static. With Comcast it works, but there will be times every 6 months or so that your IP address might change. Furthermore, if your router is changed, that means the MAC seen by their network changes, and thus your old DHCP reservation is no longer going to work. Now, if you put the old router back, you’ll most likely get your old address back, but if you change routers, it’s virtually guaranteed you’ll have a new IP. So if your’e like me and set up scripts run via an icon, those scripts will send a packet to a very specific IP (your home network) and very specific port (different port for each PC you wish to wake) and all must be configured on your router pointing to the proper MAC on the NIC, and then all of it works.

Again, things that can throw a wrench in the works are the ISP, the NIC, the BIOS of your system and the router you use. All of those may either restrict WOL intentionally, or not have the ability to pass the packet.

Another thing I’ve done is reflash my router with DDWRT. It’s been some years since I bought a new router so I haven’t kept up on how that works nowadays. It will void the warranty on the router, but the additional capabilities it provides are worth it to me. Mostly, the ability to control the wireless power output, using no more power than needed to cover the area you need. By not stressing the wireless transmitter, they live forever. At the prices of the Netgear stuff, I like that.

Thanks for your comments. It’s good to know, but I don’t want to send wake-on-lan packets over the internet. So I don’t think the subtleties of router support applies to me. I also don’t access my home network using port forwarding. My ISP router is completely closed off. I have a mini PC that’s always on, and I access it over tailscale. I can send the magic packets to my target machines from there. I intend to make this a bit more robust by connecting an IP-KVM to the mini PC. Unfortunately I need to alter my network topology a bit for that, haven’t had the time yet.