remondo
Posts: 14
Joined: Thu Feb 23, 2012 11:09 am

Re: Linux, Windows and Wake on Lan

Tue May 08, 2012 3:41 pm

I"m due to receive my Raspberry Pi within the next couple of weeks but I only have one use for it currently. I plan to use it as an always-on server simply to remotely power on my main Windows PC using a magic packet when I"m away from home to avoid leaving my PC on when I"m not using it. I"ll then be able to access my PC using remote desktop.

Providing this is even possible I understand I can use a variation of the command

# wakeonlan MAC-Address-Here
depending on the version of Linux I use. The Raspberry Pi will be connected via ethernet to the same network as my PC- eliminating any port forwarding issues, will this work as I anticipate? I imagine I"ll have to somehow remotely access the Raspberry Pi to enter the command.

Are there any exisiting apps to do something like this? Ideally I"d like a one-click solution (with password protection of course) which remotely sends the command to the Raspberry Pi, which in-turn sends the magic packet to my PC. It would be ideal if this could be done from my android mobile phone, either from an app or from the web browser.

Dapa
Posts: 44
Joined: Sat Jan 21, 2012 7:02 pm

Re: Linux, Windows and Wake on Lan

Tue May 08, 2012 5:58 pm

There should be an easier way to do this, although not as involved or fun.

I was able to get wake-on-LAN to work with a iMac a few years back, using a PHP script as the trigger, hosted on a external web server.

1. Set up wake-on-LAN as required on the PCs BIOS / OS.

2. Map a port from the WAN to the local IP for the machine e.g. 10000

3. Upload the PHP script to your web server, changing the IP / domain / port number within the script to the address used for your broadband connection.

Then, all you need to do is visit the URL e.g. :-

http://www.mydomain.com/wakeonlan.php 

...and this would send the required magic packet to turn on your computer remotely.

Here's one example script, although I haven't tested it myself in this instance http://sourceforge.net/project.....wolviaphp/

remondo
Posts: 14
Joined: Thu Feb 23, 2012 11:09 am

Re: Linux, Windows and Wake on Lan

Tue May 08, 2012 9:11 pm

Oh wow thanks, I'm a web desinger/developer by trade so this all makes sense to me. I'm sure I looked into this before and the main issue was getting through the router but I'll try the port forwarding again. I assume I can password protect the page using a simple but secure php script. I'll try and set this up when I get a minute, thanks again.

Now to find a use for my Pi...

Audumla
Posts: 1
Joined: Mon Jun 04, 2012 2:21 am

Re: Linux, Windows and Wake on Lan

Mon Jun 04, 2012 4:23 am

Hi there,
I have been setting up remote wol functionality for a small work setup and cannot see how the above solution would work reliably. The main issue is that the target machine will not have been assigned an ip if it is off. To route a port from the wan you need to route to a known ip, which is not assigned at the time. Also wol works using a broadcast packet which is picked up by the network card that matches the MAC address and not the ip contained in the message.
This is quite dependent on routers and switches rebroadcasting the sent packet, which probably won't work in a VPN or multi tiered environment.
I was hoping to use a rasberrypi as was stated in the original email as a scheduler and remote wol service device. This way I can also use it to switch everything off via ssh, etc.
When I get hold of a raspberry I may create a util do do this.

Dapa
Posts: 44
Joined: Sat Jan 21, 2012 7:02 pm

Re: Linux, Windows and Wake on Lan

Mon Jun 04, 2012 12:14 pm

A device can still have it's own IP address reserved indefinitely, even if it switched off most of the time.
Simply allocate an IP address for it which is outside of the DHCP pool.

JacopCen
Posts: 1
Joined: Sat Mar 10, 2018 4:30 pm

Re: Linux, Windows and Wake on Lan

Sat Mar 10, 2018 4:40 pm

Dapa wrote:
Tue May 08, 2012 5:58 pm
There should be an easier way to do this, although not as involved or fun.

I was able to get wake-on-LAN to work with a iMac a few years back, using a PHP script as the trigger, hosted on a external web server.

1. Set up wake-on-LAN as required on the PCs BIOS / OS.

2. Map a port from the WAN to the local IP for the machine e.g. 10000

3. Upload the PHP script to your web server, changing the IP / domain / port number within the script to the address used for your broadband connection.

Then, all you need to do is visit the URL e.g. :-

http://www.mydomain.com/wakeonlan.php 

...and this would send the required magic packet to turn on your computer remotely.

Here's one example script, although I haven't tested it myself in this instance http://sourceforge.net/project.....wolviaphp/
It turns out OP is a web designer but I am not. So can you give more details about how to write a PHP script and upload to a external server?

Return to “General discussion”