FiaRua
Posts: 2
Joined: Sat Apr 07, 2018 11:40 pm

Wake on LAN over internet with the help of RPi

Sat Apr 07, 2018 11:50 pm

I want to be able to remotely wake my home desktop on the go, without having to make my home network public. I was thinking of using a RPi as an always on 'insider' that can send a magic packet to my desktop to wake it. I have connected to my RPi via VPN (ZeroTier) via my phone and i use an ssh client to input commands (JuiceSSH) but realized the wakeonlan command would not work as it uses the physical mac address of my destop. How would i go about making this work?
Are there simpler methods waking my desktop (perhaps without a VPN?)
I have very little knowledge of networking and have been learning as i go trying to make this work. If you could go into a bit more detail so I could follow I would greatly appreciate it. Thank you for reading.

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Wake on LAN over internet with the help of RPi

Sun Apr 08, 2018 9:30 am

Wake on LAN works on the local network (aka the local broadcast domain.)
If your Pi is on the local network, you could in principle "ping" it via the VPN using some routable protocol (e.g.HTTP), and that could trigger the Pi to send a wol packet to your Desktop.
There is a wakeonlan package available on Raspbian, IIRC.

Many ISP routers offer this type of service. There's also a bunch of projects using the Pi for this, google tells me.
Look for an option named like "wol proxy" or "wol relay".
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

User avatar
thagrol
Posts: 3078
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Wake on LAN over internet with the help of RPi

Sun Apr 08, 2018 6:31 pm

FiaRua wrote:
Sat Apr 07, 2018 11:50 pm
I want to be able to remotely wake my home desktop on the go, without having to make my home network public. I was thinking of using a RPi as an always on 'insider' that can send a magic packet to my desktop to wake it. I have connected to my RPi via VPN (ZeroTier) via my phone and i use an ssh client to input commands (JuiceSSH) but realized the wakeonlan command would not work as it uses the physical mac address of my destop. How would i go about making this work?
Are there simpler methods waking my desktop (perhaps without a VPN?)
I have very little knowledge of networking and have been learning as i go trying to make this work. If you could go into a bit more detail so I could follow I would greatly appreciate it. Thank you for reading.
You're not going to be able to do this without some way into your network. The trick is doing so securely.

The usual too for sending WOL magic packets seems to be etherwake.

Seeing as you already have VPN and ssh access setup I'd go that route.

Install etherwake:

Code: Select all

sudo apt install etherwake
Find the MAC address of your PC's LAN card (note: must be a wired connection, WOL does not work over wifi). For example 00:11:22:33:44:55

Find the name of the interface your Pi uses to connect to your LAN. For example eth0

To wake your PC ssh into your Pi and run

Code: Select all

etherrwake -i eth0  00:11:22:33:44:55
"-i" tells etherwake to use the specified interface to send the magic packet (see man etherwake)

Incidentally, don't skimp on setting up the security on your network. Having looked at ZeroTier's documentaion it looks like it's more for outgoing connections and peer to peer rather than secure incoming ones. That said, I'm not a network admin so may well be wrong.

You miht want to consider setting up your own OpenVPN server instead.
Arguing with strangers on the internet since 1993.

FiaRua
Posts: 2
Joined: Sat Apr 07, 2018 11:40 pm

Re: Wake on LAN over internet with the help of RPi

Sun Apr 08, 2018 8:09 pm

Hi everyone. I actually found the solution and after your guys' suggestions i checked to see the mac address i was using only to find one digit was wrong. Connecting the pi and my phone to the same zerotier vpn works without any additional configuration. I am able to connect to the Pi anywhere with the JuiceSSH app on my phone, and i am able to send the magic packet to my desktop. For anyone stumbling here looking for a solution to wake their PC from anywhere without changing router settings (etc. public dns or port forwarding), using a VPN with pi works really well. Thank you for your input.

quickreactor
Posts: 3
Joined: Sat Feb 23, 2019 2:48 am

Re: Wake on LAN over internet with the help of RPi

Sat Feb 23, 2019 2:51 am

Hey dude I'm trying to do the same thing here, can you give me more info about how to do the connection with JuiceSSH while using ZeroTier?

Here's how I think it goes.

1. Connect both phone and Pi to ZeroTier Virtual network.
2. Open JuiceSSH and send the command to the pi at it's ZeroTier Virtual VPN
3. ???
4. Profit!

Do you have to turn the Zerotier VPN on and then off? I'm not quite sure how it works.

Thanks!

User avatar
djamos84
Posts: 86
Joined: Thu Sep 01, 2016 3:19 pm
Location: Italy
Contact: Website Facebook Google+ Twitter

Re: Wake on LAN over internet with the help of RPi

Fri Sep 06, 2019 2:11 pm

You could try the Android application "RaspController": https://play.google.com/store/apps/deta ... controller

Return to “Networking and servers”