Wake On LAN doesn't work

This is one of the reasons why I thought the process was cumbersome

If you think WoL is complex, I suggest not looking into how to remotely boot a system

We have all the time in the wwworld on this forum

1 Like

I wasn’t referring to WOL, but to Hibernate.

If the Bios/Uefi supports WOL - there is no difference between Laptop or Desktop.

I just don’t even have a LAN which I could use to wake up my Notebook.
Much easier to just open the lid or push the button :wink:

1 Like

I meant it’s different because you can take the laptop with you, so there’s no need for WOL

This seems to be the intention. @moderators I really think these two diverging topics need to be split.

split?

No need, I think.

We now know what he wants to do.

I’m not at all interested in WOL.

OP could start a new topic for suspend/hibernation and leave this one open for WoL

1 Like

That is best indeed. Fingers crossed! :crossed_fingers:

To remotely access your home computer and trigger Wake On LAN (WOL) on a Manjaro (or any Arch based) system, you’ll need to follow several steps:

Requirements for Wake On LAN (WOL)

1. Hardware Support: Ensure your motherboard and network interface card (NIC) support WOL. Check the BIOS/UEFI settings:

  • Boot into BIOS/UEFI.
  • Look for options like “Wake On LAN” or “Power On By PCI Device” and enable them.

2. Network Configuration: WOL packets (magic packets) need to be sent over the local network or over the internet:

  • Ensure your router supports WOL and that your home network allows WOL packets.

3. Operating System Configuration:

  • On your home computer, you need to configure the NIC to allow it to wake the system.
  • Install the ethtool package:
sudo pacman -S ethtool
  • Use ethtool to enable WOL:
sudo ethtool -s <interface> wol g
  • Replace with your network interface name (e.g., eth0, enp3s0).

Setting Up Remote Access

1. Remote Access Tool: Choose a method for remote access:

  • SSH: This is the most common method. Ensure sshd is installed and running on your home computer:
sudo systemctl start sshd
sudo systemctl enable sshd

2. Router Configuration:

  • Set up port forwarding on your router to forward the SSH port (default is 22) to your home computer’s local IP address.
  • Dynamic DNS (Optional): If your home IP address changes frequently, consider setting up a Dynamic DNS service to get a consistent hostname.

Configuring Wake On LAN

1. Find MAC Address: You need the MAC address of your home computer’s NIC:

ip link show <interface>

Look for the link/ether line.

2. Install WOL Tools on Remote Machine: On the machine you will use to send the WOL packet, install a WOL utility. You can use wakeonlan:

sudo pacman -S wakeonlan

3. Send WOL Packet: From your remote machine, you can send a WOL packet:

wakeonlan <MAC_address>

Final Steps

1. Testing WOL: Before relying on remote access, test WOL while on the same network to ensure it works. Use:

wakeonlan <MAC_address>

2. Remote Access: Once WOL is confirmed, you can access your home computer remotely. If you’re using SSH, connect using:

ssh user@<Dynamic_DNS_or_Public_IP>

3. Consider Security: Ensure your SSH is secure:

  • Use key-based authentication instead of passwords.
  • Change the default SSH port to reduce unwanted access.
  • Set up a firewall (ufw, for example) to restrict access to the SSH port.

Summary

To remotely access your home computer and trigger WOL:

  • Ensure hardware support for WOL and configure BIOS/UEFI.
  • Set up your NIC with ethtool.
  • Configure SSH and router for remote access.
  • Use a WOL tool to wake your computer from another device.

With these steps, you should be able to successfully connect to and wake your home computer remotely.

Disclaimer:- This post has been brought to you by ChatGPT; with several edits of content for accuracy and presentation.

3 Likes

These are essentially the steps that I followed until now.
But reading step 2 of the requirements, you made me think I should check if the router is somehow blocking this traffic.
Is there a way to test if the magic packet reaches my PC, at least when turned on?

Replace enp8s0 with your Ethernet device name.

sudo tcpdump -UlnXi enp8s0 "port 40000" 
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on enp8s0, link-type EN10MB (Ethernet), snapshot length 262144 bytes

Sent magic packet, and I get:

15:59:32.877439 IP 10.2.4.1.17747 > 10.2.4.255.40000: UDP, length 102
        0x0000:  4500 0082 281f 0000 4011 3549 0a02 0401  E...(...@.5I....
        0x0010:  0a02 04ff 4553 9c40 006e 0acf ffff ffff  ....ES.@.n......
        0x0020:  ffff d85e d304 13f7 d85e d304 13f7 d85e  ...^.....^.....^
        0x0030:  d304 13f7 d85e d304 13f7 d85e d304 13f7  .....^.....^....
        0x0040:  d85e d304 13f7 d85e d304 13f7 d85e d304  .^.....^.....^..
        0x0050:  13f7 d85e d304 13f7 d85e d304 13f7 d85e  ...^.....^.....^
        0x0060:  d304 13f7 d85e d304 13f7 d85e d304 13f7  .....^.....^....
        0x0070:  d85e d304 13f7 d85e d304 13f7 d85e d304  .^.....^.....^..
        0x0080:  13f7                                     ..

This is from my router running pfSense (FreeBSD). That was my first question after this wall of text. How is this router actually sending it? Broadcast, MAC address, failing on unicast?

Is this a magic packet? I don’t have the skills to interpret it… :sweat_smile:
If yes, I suppose every packet of the same type as yours should look the same.

Unfortunately, I don’t know, which is why I chose to enable all (except “p”) the modes supported by my NIC, and also try to send the packet from my Windows laptop with WakeMeOnLan.
My router only asks to insert the target MAC address.
Regarding WakeMeOnLan I wouldn’t know how it sends the packet…

The MAC address of your home computer, or rather, the NIC of your home computer… Either of these commands (run on that computer) should return available MAC addresses in the local machine:

  • ifconfig -a
  • ip link show

When you have the address that is applicable, write it down and keep it somewhere safe. When connecting from your laptop with WakeMeOnLan, insert that MAC address when asked.

Choosing enable all infers that the MAC address method is also enabled, and the MAC address request is a consequence of that.

I’m unable to help troubleshoot, beyond this.

Good luck.

Sorry, but I didn’t mean “how to use these tools” but rather “the way they work under the hood”.

Yes. they are not identical. You can ignore the hex portion for the most part. The only part I was looking at is the three occurrences of FFFF, starting at 0x0008. That is the magic part of the packet. I know, not very magical.

But it will just be blank if it’s not getting anything on the default WoL port. You should see the source IP from your router if it’s sending the packet.

When I VPN to my router, and when I send that packet, my PC turns on. As you can see from my tcpdump, it sends to my broadcast (10.2.4.255). (Also shown in: ip address/ip a for your Ethernet device if you don’t know it.)

I know WoL can work without using broadcast, but that is the way pfSense does it. (And is more common.)

I thought the default ports were UDP 8 and 9… So is it the 40000?

That’s where WoL gets tricky. You don’t even need a TCP/UDP packet (or port) at all.

It’s looking for 6 bytes of FF followed by it’s MAC address 16 times, in any given Ethernet frame. I can spot that pattern in my hex dump (especially if I grow it.)

UDP port 40000 has been my default for I don’t know how many years decades. But I remembered that as soon as you said it. It was standard to use UDP 7 or 9. (Like I said it doesn’t even matter, except that if you use IP, it should be UDP over TCP.)

I have no idea what your router is, I don’t think you have mentioned it.

Here’s another one to try, you can listening to those lower ports.

sudo tcpdump -UlnXi enp8s0 "src 10.2.4.1 and dst 10.2.4.255 and (port 7 or port 9)"

(Again, replacing with your Ethernet device name, router IP, and broadcast IP.)

If there is still nothing, try listening to all broadcast IP packets:

sudo tcpdump -UlnXi enp8s0 "dst 10.2.4.255"

But you may have to do some combing with that one.

I mentioned it in the OP :wink:
Thanks for your thorough explanation; I’ll try it as soon as possible

Sorry, I’ve been power-skimming a lot with my new job.

So no SSH access to your router? That makes troubleshooting this blackbox a little tougher. (No Merlin firmware? :wink: )

But you can always use another Linux device, or even your phone to send the packet. Then what you troubleshoot next depends upon if it worked or not.

Otherwise, we can only assume this router is sending a UDP broadcast packet. Iit’s how WoL is implemented every time I’ve seen or searched it. But as we know, the port doesn’t matter, so we probably can’t filter by ports with it.

But that last tcpdump example, doesn’t get anything, or gets too much?

Even better:
sudo tcpdump -UlnXi eth0 "src 192.168.1.1 and dst 192.168.1.255"

That will capture all broadcast from your router only, so I would bet it would come up there.