Wake-on-lan, windows 10 and Linux

Well, after having wake-on-lan running and working great (other than the stupid sleeping after a couple minutes issue) I decided I would do a quick post on how I got it working and my setup, it was actually very easy once I found the right package.

First, my overall setup. Linux/Ubuntu firewall, running iptables. 2 VLans, one for everything else. My desktop is on the client VLAN and the linux firewall acts as the gateway between both VLans and the internet.

My solution, SSH into the firewall, run a command on linux and wake up my computer. My prefered solution, and coming up eventually, a web page to do it so I don't need SSH to do it. Yay.

I did run into one thing that kind of threw me for a loop, running the command didn't always wake the computer. So. I created a script that runs it 10 times and that has worked every time.

Steps:

  1. Enable Wake-On-Lan on the desktop. Out of scope of this document, but it's pretty easy. Quick google search and you'll find it.
  2. Install wakeonlan on the firewall sudo apt-get install wakeonlan
  3. Run the wakeonlan command, broadcasting out on the correct subnet.
    wakeonlan -i <broadcast ip> <mac using : seperators>
    A wakeonlan command for broadcasting on the 192.168.0.0/24 subnet
    wakeonlan -i 192.168.0.255 00:11:22:33:44:55
    A wakeonlan command for broadcasting on all interfaces
    wakeonlan 00:11:22:33:44:55
  4. Enjoy the power and cost savings
  5. Eventually build a site to auto-run that command