13

I'm trying to wake my PC using WOL (Wake on LAN) from my pi. I enabled Wake on LAN in the device manager for my ethernet adapter and enabled it in my bios. When the computer is switched off, the lights of the ethernet port are on.

Now, on my pi, this is how I tried to send the magic packet :

root@raspberry:~# wakeonlan 00:11:22:33:44:55
Sending magic packet to 255.255.255.255:9 with 00:11:22:33:44:55

When I send this command, I get a message that it is sending the packet, but my PC does not switch on.

00:11:22:33:44:55 is the mac address of my ethernet port on my windows. The pi and my PC are on the same network. I'm trying this for the first time, so please comment if I've done anything dastardly stupid.

My PC runs Windows 7 Ultimate.
Pi runs Raspbian (linux).

Note : I replaced my real mac address with the one above.

7
  • That's not a valid mac address, so that's why it doesn't work (Not valid as in there's no manufacturer known for that MAC.) Most start 00:0e.... Oct 13, 2016 at 12:12
  • 1
    @djsmiley2k: That doesn't automatically make it invalid though. While it's a bad idea to use an unregistered OUI (it's better to set the 'locally administered' bit instead), that doesn't actually prevent such MACs from working in any way at all. Or, possibly, the OUI could have been a private registration (IEEE offers those at an additional price). By the way, manufacturer prefixes have gone way beyond 00:0e: in the past few years. Oct 13, 2016 at 12:41
  • 1
    @djsmiley2k: eh, I wouldn't be surprised if they ended up downloading one of those little 'MAC randomizer' tools, or if some security shovelware did that automatically, or if they got a knockoff NIC with an unregistered OUI ... or if they just mistyped the MAC address. Oct 13, 2016 at 12:46
  • 1
    Sorry, I changed my real mac address very slightly but now I think I should have just typed 00:11:22:33:44:55. I wasn't sure if there was any mac address related scams. Plus, I'm pretty sure mine is a custom one that I changed to in the network address tab in the properties menu of my network card. (Did it from device manager.) (You were wrong about that part @djsmiley2k). Oct 13, 2016 at 13:05
  • 1
    Not stupid, makes sense and better to be safe than sorry. I don't know of any mac address related scams other than maybe the telephone call from your 'isp' claiming something and reading off your mac to you to 'prove its them'. Ok so if that's not the issue then I'm unsure what is. Oct 13, 2016 at 14:33

2 Answers 2

8

Your command looks correct. So I would next go to the Windows PC to troubleshoot using a traffic capture tool.

To see if the packet is actually getting to the PC, you can install Wireshark, select the relevant interface to monitor, start the capture and then type 'wol' in the display filter. Then send a wakeonlan packet to the windows machine from your Pi again. You should see this traffic come up in the capture.


Additional Information

WOL Behavior Note, WOL will only work on the same subnet in your example, as MAC Addresses are a Layer 2 addressing method that only spans a single broadcast domain.

MAC Address Structure The first three blocks (::**) should be vendor unique for physical hardware. Virtual Machines are the only devices that, by default, bypass the MAC Addressing standard. You would have to manually tell a physical device to mascarade its MAC address.

Better Ways to Get Your MAC Address Secondly, a better way to get your MAC address is by going to the Command Prompt and typing ipconfig /all. OR Start > Control Panel > Network & Internet > Network & Sharing Center > Change Adapter Settings > Right-Click (the relevant interface) > Status > Details The Physical Address is your MAC address and will use '-' instead of ':'. Note that you still have to use ':' with the wakeonlan command on your Pi.

I hope the above helps. Sorry if this is unclear, I am new to posting on superuser

Wireshark Capture Setup Example - 1:

Wireshark Capture Setup Example - 1

Wireshark Capture Setup Example - 2:

Wireshark Capture Setup Example - 2

3
  • +1 Let me try this out and see if the packet reaches the PC. Could you please elaborate on WOL Behavior? Oct 13, 2016 at 15:34
  • 1
    @Don'tRoothereplz..., WOL Behavior is not so much the actual WOL behavior, more the limitations of the Network Layer on the Data Link Layer address broadcasts: Layer 3 - Network Layer - separates broadcast domains and give you the ability to identify different subnets, e.g. 192.168.1.2/24 is part of the 192.168.1.0/24 network (broadcast domain). The MAC Address will not traverse different broadcast domains.
    – A. Morton
    Oct 13, 2016 at 16:05
  • 1
    A word of warning with using IP addresses for Wake On LAN: You would have to send to the broadcast address of the other network to wake up any or all devices, as the IP address will not respond while the device is turned off. Alternatively, you would have to create static MAC address entries on the router for that subnet (if it supports that feature) to automatically translate the IP address to the MAC address.
    – A. Morton
    Oct 13, 2016 at 16:09
6

You'll have to confirm 3 things when it comes to your PC. Your Pi seems to be sending out a signal, so it's fairly safe to assume that is working properly.

You already said you have them checked, but I've had bios shutoff WOL on it's own before, so double check it.

  1. Bios is enabled for WOL

This is disabled by default on most devices, so re-verify that it's enabled.

  1. Device (ethernet) in OS is enabled for WOL

Get over to your Device Manager and click on your network adapters. Locate your device and right click on properties. Click on Power Management and ensure you have it enabled.

Power Management

  1. Firewall is open for WOL *** I didn't see you had a comment on this.

WOL typically goes either over port 7 or port 9. I would recommend opening both on your firewall until you get this going, and then close one once you got it setup. 9 is more common.

There are software programs to help with this, but most of the time I find them to be just as confusing than helpful.

5
  • 1
    How would the firewall help in that situation.. if the PC is off, then the firewall is not running.
    – WORMSS
    Jul 7, 2017 at 14:04
  • @WORMSS By enabling the device to accept the WOL on the device setting, you may also need to the device to accept based on subnet / broadcast port. en.wikipedia.org/wiki/Wake-on-LAN Take a look as the security aspect. Basically you're allowing the NIC to accept the packet, both by BIOS and software, each is able to lock the NIC out from WOL
    – JustAGrump
    Jul 7, 2017 at 18:16
  • But, the OS will not be active when the machine is completely powered off.. It's all hardware.. Windows(and your Firewall) (depending on your setup) wont even be booted up for 20s to 2 minutes after the Magic Packet has been picked up by the network card and started powering up the computer.. Are you talking about waking from Sleep mode or Full Power Down?
    – WORMSS
    Jul 7, 2017 at 21:35
  • @WORMSS Both have control of the device, and how the device is to perform. Thus while the OS isn't "on", it does control how the device. The Ethernet port is different on this than, and on older systems it wasn't possible. You'll have to research it if you want more in depth answer. However you look at it, the device needs to be enabled to accept it by both the BIOS and OS on most systems.
    – JustAGrump
    Jul 11, 2017 at 18:09
  • One also needs to ensure the firewall on the machine sending the "magic packet" is allowing the signal out. I usually just turn my firewall off when I test this process on a new machine.
    – Mark G B
    Oct 1, 2017 at 20:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .