Geeks With Blogs

News 'If all the economists were laid end to end, they'd never reach a conclusion.' George Bernard Shaw

Always code as if the guy maintaining your code would be a violent psychopath and he knows where you live.

Follow me on twitter @westleyl.
Liam Westley His incoherent ramblings

The problem

I am moving my server and main development system out of a home office into rented office space.  As I'm only going to be in the office two of three days a week, and being a hippy environmental type, I wanted to ensure my file server was not always switched on.  Anything to reduce my carbon footprint a fraction.

The solution

WakeOnLan was the perfect solution I thought.  I configured the server in the BIOS to start up on a Wake On LAN packet.  With this I can turn on the server, and once the server is running I can use RDP (Remote Desktop Protocol) or VNC to remotely connect (I'll configure a proper VPN later).  Once I finish using the server I can use RDP to turn off the server again.

It all worked on the local LAN, but getting it working remotely across the Internet was slightly more work.  Thanks to Googling some excellent articles it only took around 90 minutes to figure it all out.  The Linksys router was the main stumbling block in my setup.

Basically, WakeOnLan uses broadcast technology to send a 'magic packet' to all computers on the LAN.  This packet contains the unique MAC address of the LAN card belonging to the PC you wish to turn on.  Some forums/blogs suggest port forwarding or port triggering to a specific IP address but neither work on the WRT54G.  As the server will not have an IP address if it is not switched on (as the O/S configures this) you cannot port forward in the usual manner. It is possible to port forward to ALL PCs. However, when using the default subnet of 255.255.255.0 the WRT54G does not allow port forwarding to the broadcast address, xxx.xxx.xxx.255. The web interface simply won't allow you to enter xxx.xxx.xxx.255 as a destination IP address.

Configuring the router

Fortunately I found this blog n01getsout.com which provided the solution. In the Linksys web configuration, you have to specify the subnet for the LAN DHCP pool as 255.255.255.128.  You then configure the port forward (on any port, 5850 was one suggestion of a free port) to forward to xxx.xxx.xxx.127 which will forward the magic packet to all PCs on the network.  The MAC address within the packet ensures that only that the specified PC turns on. Note: the WakeOnLan packet is not port specific so the destination port does not actually matter.

Wake On LAN utility (to send the magic packet)

The last step is to obtain a WakeOnLan utility to send the magic packet.  If you're running Windows there is a great utility from depicus.com which does exactly what you need.  You enter the MAC address of your PC (in a command window, ipconfig /all, it is listed as physical address), the public IP allocated by your ISP (I used whatismyipaddress.com for this), a subnet of 255.255.255.255, and the remote port number you configured in your router for port forwarding.

And that was it - now I can remotely switch on my server, do some work and then turn it off when I'm finished.

Posted on Wednesday, February 21, 2007 9:45 AM Hardware , Hosted services | Back to top


Comments on this post: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Hi,
thanks for your great article.
However, it seems that not all circumstances are covered, because my setup does not work. I can wake inside the LAN. Waking from WAN does not work. What Linksys Firmware Version did you use ?

Cheers...
Left by Marc on Mar 29, 2007 11:39 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Marc - here's the details from my LinkSys web interface;

Hardware Version: WRT54GX
Firmware Version: 1.02.06
Boot Version: 2.01.08
Left by Liam Westley on Mar 29, 2007 12:51 PM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Im currently using a WRT54GL v1.1 with firmware version 4.30.5.

I just got my laptop setup to use the microsoft remote desktop so that I can take it on the road, and still access my desktop at home.

Im not using Linux or anything except Microsoft. Will this work for me?
Left by Alex on May 05, 2007 6:51 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Alex,

I can't see a problem with it working. The router isn't a huge issue, the important bit is to configure your desktop PC so that it wakes on LAN.

You can test the basic Wake on LAN setup on your local LAN, with no router being involved, before heading off on the road to see if it works via port forwarding to a broadcast address.
Left by Liam on May 07, 2007 8:51 PM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Hey Liam,
Great post - very clear.I still have few questions ....

- I did not really get the subnet change ... but I will get past that :)

- you did not mention the fact of the IP (if you had a dynamic one or a static one).I have a dynamic one and wanted to check if you tried this or not. (I know linksys is using the dyndns service, among others and see how good it was)

- do you know if the WOL will work with an set of Ethernet bridge over power AC ? You know the thingy you can plug on the wall and re-wired somewhere else using the power outlet ?

Thanks a lot,

best

Sebastien
Left by Sebastien on Aug 08, 2007 4:28 PM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Sebastien,

A dynamic IP address is no block, use a service such as dyndns. I have used no-ip.com in the past, they have a free version and a Windows service for keeping your IP address current.

I haven't tried WOL on an AC Ethernet system, but I cannot think of any reason that this would not work. I believe it acts as a standard Ethernet network so the broadcast packets used by WOL should function as for a wired or wireless network.

Thanks

Liam
Left by Liam Westley on Aug 12, 2007 8:27 PM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Hi Liam,

Very good post - thanks for sharing.

I'm fairly confident I have the routing side of this straight, I can not determine if my server(s) hardware is configured appropriately.

I've ensure the BIOS for each of my destined WOL pc's are configured WOL as enabled.

I'm using TrendNet TEG-PCITXR network adapters and the spec says they support WOL.

I am anticipating that I need to make some physical connection from the network interface to the motherboard ... but when I study the NIC I can't find any jumpers that or any description of WOL.

Consequently, I am not connecting the card to the motherboard - just pci slot.

And I can not get my servers to wake up.

Thanks for your assistance,
Brian
Left by Brian Mark on Jan 26, 2008 3:40 PM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Brian,

I had a quick peek at the documentation for the TrendNet adapter and agree - no WOL pins. I've seen these pins on network adapters I've had in the past (they also came with the WOL cable for connecting to the motherboard).

However, on my Shuttle SB51G BIOS I didn't actually have an option called 'Wake on LAN' for the integrated network card. Instead there was an option called 'Wake-up via PCI card' and that did the trick.

It's quite possible that the TrendNet card supports WOL via this PCI spec 2.2 feature (it is listed as being a PCI 2.2 card). This may be the 'modern' way of doing WOL.

Hope that helps,

Liam
Left by Liam Westley on Jan 29, 2008 10:22 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Hi Liam,
Fantastic faq you have made here ive been looking for something like this for some time now :D

However i have followed the instructions and it dosent work for me (internal works fine but then you are broadcasting on the same subnet), does this work with the newer firmware ? i have Firmware Version: v7.00.4 on a WRT54G router.

1) changed the dhcp to xxx.xxx.xxx.128

2) configured port forwarding for xxx.xxx.xxx.127 port 5850.

3) found mac addys for pcs

4) tried the online dipicus.com wol tool no joy.

5) looked in the routers log and i see packets coming in from the website on port 5850

or should i be using the command line version of wol?

or is there something stupid i have forgotten?

huge thanks in advance.

Sonic

Left by SonicASUK on Mar 12, 2008 2:32 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Hi everybody,
I have the same problem, solution described above doesn't seem to work with Firmware Version: v7.00.4 on a WRT54G. The only possibility, how to make it work is, to configure the LAN adapter to use dhcp --> it creates an arp record in router dhcp clients table. But this record expirates after some time (max 7 days), moreover, I am afraid, that there is no possibility to guarantee, that the local IP adress assigned to the server does not change. Any ideas are welcome. Thanks Dousin
Left by Dousin on May 02, 2008 11:08 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Does it have an option to configure static ARP? If it does, assign static IP to your PC and create a static ARP entry in your router such that the PC MAC is statically mapped to the PC IP address.
Left by Eddie Ng on Jun 26, 2008 5:11 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
What a useful post! Thanks so much. I do have one problem though... I am on a DSL connection, and my IP address changes several times daily. No-ip.com looks like a great service, but obviously it's not going to work if my computer is on standby... :) Any thoughts on how to get around this? Thanks!
Left by Dane on Jul 06, 2008 4:23 PM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Ah... sorry for not doing my research before asking above... all you have to do in such a situation is set your modem to "bridged" configuration and have your router (which hopefully supports dynamic dns!) handle the PPPoE.
Left by Dane on Jul 07, 2008 4:13 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Hi,
I have a Linksys WRT54G too, but I can't afford to change my subnet mask to 255.255.255.128 since I have IP addresses out of that range.
But I found an easy way to create a port forward with a 255 value: using Firefox with an extension called "Tamper data" I was able to capture the values sent to the router by the page.
This way I "tampered" the field value after pressing the "Save settings" button, and assigned a new value of 255. It works like a charm!
Now I have broadcast and kept my IP addresses.
Left by agpe on Aug 09, 2008 12:27 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Awesome instructions! Thanks for posting. Works great with the Linksys RT31P2
Left by TheMan on Aug 09, 2008 7:55 PM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
thanks for information. it realy works. It's better solution, then trying to overgo standart router limitations(1-244) , i think
Left by mokamoka on Feb 01, 2009 11:40 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
mokamoka, can you please explain the sequence involved using Tamper Data? I'd tried this months ago but couldn't get it to work. I can Wake over the internet shortly after shutdown but then after the first ARP request it can't even wake the one PC. That is why I need to broadcast. Thank You!
Left by ratchet on Feb 03, 2009 11:30 PM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
You can also temporarily disable javascript in order to get the port forwarding page to accept 255.

However I am in the same boat as several other posters. My firmware (v1.02.5) doesn't seem to forward the packet. (WoL works internally, but not externally)

Maybe this only works with a WRT4GX and not with plain G?
Left by rephorm on Mar 01, 2009 4:09 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Afraid I can't help as only have WRT4GX, and the top google results come to same conclusion - it doesn't port forward the WoL packets.

Sorry,

Liam
Left by Liam Westley on Mar 02, 2009 11:22 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Thanks a lot, it works on linksys RT31P2
Left by srimals on Jul 28, 2009 11:33 PM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Hi,

i have a WAG160N but i cant get the wol packets to broadcast to all computers in the LAN. is there other firmware for WAG160N that have this feature? or how do i allow broadcast. i tried changing the subnet mask it does not work.
Left by Nel on Oct 03, 2009 2:49 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
I have used address xxx.xxx.xxx.125 since 127 was not working for my iMac with Snow Leopard, but this is really valuable Information and I thank you for that, I have the WRT54G router and it is working like a champ
Left by Ralph Martin on Oct 24, 2009 2:11 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
(I am using a WRT160N) I have tried the xxx.xxx.xxx.127 and xxx.xxx.xxx.125 but no result.
(can't do a broadcast over xxx.xxx.xxx.255, i will get the message that the range is from 1 to 254)
I tried everyhting.
As fare as i can retrieve, the router is losing his ARP entry after 4 to 5 minutes. Within that time, it is possible to wake up my pc over the internet. Outside that time, and it is not possible anymore.
I tried the wake on lan monitor, but i doen't see any broadcast passing by.
Any tips or tricks are welcome.
Thanks
Left by Jecho on Nov 08, 2009 10:55 PM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Better to get a non Linksys router if you intend to mess around with WOL. Linksys seems to have disabled broadcast passing in their firmware. DD-WRT might be worth trying for those more adventurous.
Left by James on Jan 08, 2010 9:13 PM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Have thought about this and realized why this works and not for some. When you changed the subnet mask on the router you opened up the broadcast channel on the network. Normally a home lan would look like 255.255.255.0 for the subnet and a broadcast of 255.255.255.255 and the linksys wont allow the last three of the address to be 255. By altering the subnet to 255.255.255.128 you are splitting the network into two sections. Now the linksys will be able to set the 192.168.1.127 broadcast over the network; because, it is not 255. I think what a lot of people are having a problem is the subnet mask configuration on their systems. Change the subnet mask to the appropriate network (255.255.255.128) and it should work. The reason people are not complaining about the connection to the internet is they are on another network segment.
Left by pat on Aug 10, 2010 7:14 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
These instructions helped me finally get WOL to work, but only locally on local subnet. Does not work over internet. I have double and triple checked everything
Left by kneeL on Feb 03, 2011 9:33 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Oh nevermind - Sorry for double post--

In my Cisco E3000 settings under Security I noticed "Filter Anonymous Internet requests" or something, was checked, and figured that was probably it, and unchecked it. Then, using these instructions, works on the 'Internet' setting, in the Dipicus WOL GUI tool now, as well as Local Subnet.

Thanks for the help -- Anyone having problems and gets it to work using cisco/linksys only on local subnet, try finding that option
Left by kneeL on Feb 03, 2011 9:39 AM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
I have a linksys wag160n and I can wake my computer on LAN with no problems, however when I try to wake online it simply will not work. I have tried changing the subnet mask to 255.255.255.128 and forwarding the port to 192.168.1.127 and it simply will not connect. When I spoke to linksys support they said this router in not compatible with wake on wan but I have seen articles saying that it will work if I create a static arp entry.

I am using dyndns in my router which works fine for remote desktop but I cannot remotely power on my pc

Any help would be greatly appreciated.

(I checked DD-WRT and unfortunatly the wag160n is not compatible)
Left by ian on Apr 26, 2011 11:00 PM

# re: Wake On LAN remotely via your broadband connection - with a LinkSys WRT54G
Requesting Gravatar...
Thank you for all information. Using broadcast address on subnet 192.168.100.0/25 works nicely on WRT54GC too. I wanted to keep the usual UDP port 9 on the magic packet though.
Thanks again,
Cristian
Left by Cristian on Feb 28, 2012 7:45 AM

Your comment:
 (will show your gravatar)


Copyright © Liam Westley | Powered by: GeeksWithBlogs.net | Join free