How I got my Linksys WRT54G to Broadcast WOL Packets to my LAN
In my particular set up I have a cable modem, piping internet to a VOIP router piping internet to a wireless Linksys WRT54G router piping internet to my machine.
I wanted to be able to turn on my computer at home without having to call my dear wife and ask her to march downstairs and fire it up. Here are the steps that I performed to make it work:
- Prep the NIC Card: Start>Control Panel>Network Connections>Local Area Connection>Properties>Configure> Then looked around for Wake Up, Wake On LAN, settings under the advanced tab and made sure that everything was enabled for magic packets.
Then I went into the power management tab and unchecked the "Allow the computer to turn off this device to save power" checkbox. - Prep the Motherboard: While my computer is booting I see the Dell logo and some text about how to get into settings or BIOS (typically F2 or F10 or F something). Once I was inside the BIOS I looked around for settings in regard to Wake on LAN sometimes abbreviated WOL. I made sure that WOL was enabled.

- Prep the Routers: This is where it gets interesting. Linksys doesn't natively support forwarding ports to the broadcast IP of 255 (you get some JavaScript error "IP value is out of range [0 - 254]"), so to get around it you can try one of two methods (they both worked for me):
1) I used firefox and DOM Inspector to change the value of the IP for port forwarding thereby circumventing the Javasacript validation. You have to have DOMI installed in Firefox, then inspect the page with the port forwarding for applications and gaming, then right-click the value in DOMI, choose edit, and set it to 255. After that is complete just save the settings.
2) I also tried saving the html page and modifying the form manually. This also worked like a charm. You need to remember to change the action property of the form to prepend the url of the router. If your router was 192.168.1.1 then your form tag might be <form name="portRange" action="http://192.168.1.1/PortRange.tri" method="post"> assuming PortRange.tri was what you orginally found in the form. You also need to change the value of the IP you're forwarding to be 255. This is what my HTML looked like when I was done:
<input class="num" onblur="check_valid_value(this,0,254,errmsg.err34,this.defaultValue,lanip,networkip,broadcastip)" maxlength="3" size="3" value="255" name="ip1">
On the VOIP router I just forwarded the port I decided to use as the Linksys WRT54G which forwards to the broadcast on my LAN.
Wait, what UDP port am I forwarding you ask? It doesn't really matter. Typically WOL is on 7 or 9 but as long as you pick a port that isn't being used by another application (in other words pick something really high) then you're probably just fine. - Test the setup: So, to test the Wake on LAN settings I used this WOL monitor and wrote my own application for sending packets. Why would I write my own packet sender? Because I couldn't find one out there that didn't apply the subnet mask to the IP and broadcast the message. With my setup I wanted the packet to go directly to my VOIP router, so I built my own WOL application. It's pretty simple:

If you're having a hard time getting WOL to work for you, then try this forum to get your particular issue sorted out.
Update:05/27/2010
New! I have an Android App available for WoL and WoW. It's called WoL Wake on Lan Wan. Check it out here: http://blog.benfinnigan.com/2010/05/android-market-update-wol-wake-on-lan.html

Disclaimer: The views expressed in this blog entry are provided "as-is" with no guarantee expressed or implied. If tweaking this stuff bricks your box or your router I'm not responsible. Any sites I've linked to are not to be construed as an endorsement and I cannot be held responsible for anything that goes on within other internet sites and their products or forums.
17 comments:
Hi there,
Thanks for posting this, it was just the solution i was looking for. I was struggling to get my WRT54GS to WoL but now it works perfectly!
Although i must admit that I could not get the most crucial step to work.. step 3.. at first anyway! I did try with the DOMI method, but it couldn't seem to get it to work and I did not quite understand the HTML method.
Instead I loaded the page in firefox, disabled Java, entered 255, restarted Java and clicked 'Save Settings'.
Thanks for your help!
Chaz
Chaz~
Good thinking! I hadn't really thought about changing that setting *while* the page was loaded. Glad to hear that it worked out for you, isn't it ridiculous that they don't have an administrative override for this functionality?
Yes it is frustrating, I did toy with the idea of upgrading the firmware with a custom version - but I thought it was too risky!
One thing I forgot to add is that you need to click 'outside' the text box after entering '255' as this is when the java script would normally kick in.
I wanted to thank you for this little tutorial and ESPECIALLY for the WoL app that you wrote. This info and the app I needed to get Wake on Wan working. I actually ended up using a different work around for the broadcast forwarding:
left the router subnet at the default 255.255.255.0.
created a port forward to 192.168.1.31 on port 9 udp and saved the settings.
returned to the router subnet setup and changed it to 255.255.255.224 and saved the settings.
Now that the forward was set previously, it didn't run the verification for accepted ips to forward(192.168.1.31 is broadcast on the first 255.255.255.224 subnet).
fired up your WoL app and viola!
I've tried almost everything I found here and there but nothing seems to work for me.
WoL works perfectly if I invoke it with a computer on the same LAN, however it doesn't work over the internet.
Both methods for imputing *.*.*.255 as my broadcast address failed. I decided to change my subnet to *.*.*.128 which means my broadcast address should br *.*.*.127. Still no luck.
I have a "Magic Packet Monitor" and it doesn't register a packet sent over the internet. It works perfectly on the LAN itself.
I'm running Firmware Version: 1.01.08 on a Linksys WAG200G.
Any ideas guys?
Thanks in advance!
I've used my own app to wol in the past written in c# with code taken from:
http://www.codeproject.com/KB/IP/cswol.aspx
and it has worked fine until VOIP go into the picture.
Your app works great when I turn off broadcast. Would you be willing to share your code? Or perhaps tell me how you've turn off broadcast in your app.
I tried remming SetClientToBrodcastMode but that didn't work.
Well, I build the packet myself and send it. That way I don't have to bother with any of the higher-level programming getting in the way.
Saviour! (sort of...) I can wake up my home pc with your software, but not via depicus woli or any of the other online web interfaces for WOL that I know of. It's your "Do Not Broadcast" tickbox which seems to be the difference. Are there any web interfaces that have similar functionality? Restriction to your software may be a problem because at work etc. I'm behind a proxy server which authenticates, and I doubt it will work behind it. [ Perhaps the code could be adapted for PocketPC and I could wake via that? ] These are small problems that I'm sure I can fix somehow.
One of those who replied had a WAG which caused grief. I have one of those too (a WAG54GP2v2), so here's how I fixed the problem (after setting the router up with DynDNS.org, which will certainly make this less messy because many of the linksys routers have functionality with DynDNS.org built in). Look over another good tutorial at http://www.smallnetbuilder.com/content/view/29941/53/ I could only get this to work if I followed their instructions for A) static DHCP (associating a specific internal IP address with a specific mac address) + B) the recommendation to use wireshark proved very useful. After using that, it seems that the only 'listening' port I could forward was UDP 5938 - UDP 9 seems to be no good for me. Hence, now I forward 5938 UDP to 192.168.1.65 (the static DHCP which I set for my home pc). In WOL, I use MAC | host service name from DynDNS | all 255s for subnet | 5938 as the port | and 'Do not broadcast' WORKS GREAT, thanks!
NB. It's probably redundant now for me(?), but this might be useful for others: I found another way to port forward to the otherwise-out-of-range '.255' (I could use the DOM inspector to change the value to .255, but I couldn't seem to save it. How do you achieve that?). The linksys firmware has ability to backup/restore to/from a txtfile (Administration tab; "Backup&Restore") => set up the port forward as explained in the tutorial, but leave the last number as something within your router's scope (I used .31, but at that stage I had some other subnet. It shouldn't matter what final number you use, as long as it's within range). Backup to text file; edit the textfile in notepad; search for a line which looks like forward_port=WakeOnLan:on:udp:5938:5938>31 (I called the portforward 'WakeOnLan' so use whatever label you inputted earlier as the search criterion); change the '31' to 255; save; restore from the same window in the firmware. Done!
Hi Brad,
I did code this into a web application, but it looks like my hosting company won't allow sockets to be made from websites. If anyone was willing to host the application for me in a fully trusted environment we could get something out there -sigh-.
Hi Ben,
You really have pulled together a nice tutorial. Unfortunately, I have a WAG54G2 and following your instructions, I think Linksys stepped up their security. I, for one, cannot think of any possible reason why they cant enable this feature, not go and step it up. I am hating linksys right now. Even my friends (no name) Chinese router has the ability of WOL. Please, if you know any other references or link or if you know something yourself, please let me know. I have googled all sort of queries and im not coming up with anything.
Thanks for your informative tutorial though, at first I was excited, only to find it doesnt work for my model even though the web interfaces and router configurations are almost teh same.
I found a simpler way of tricking a Linksys router into accepting the broadcast address. Worked with FF but haven't tried IE. Basically you just get to the Port Range Forward page and then turn off JavaScript in the browser. Fill in your information (including broadcast address 255 for example), change from that field get to a different field and then re-enable JavaScript in the browser. Save your settings. It saved just fine for me, but unfortunately I can't test WOL as it's with a friend's router that doesn't have WOL enable on the computer.
Blogger Matthew said...
I found a simpler way of tricking a Linksys router into accepting the broadcast address.
This worked great for my WRT54G2 - fantastic tip. Thanks Matthew!
Step 3 doesn’t work for me. Using Firebug, I removed the onBlur and changed the value to 255 and it either doesn’t keep the value or gives me this error, “The values you entered are invalid. Please try again.”. The error is not a JS alert, but actually written out to the screen with the “Continue” button.
I also tried disabling JS and saving the page and editing the HTML, all with the same results.
It is as if they are doing “server-side” validation now.
I struggled with this and managed. Actually sdtacoma, I looked into your firebug thing and used it and it just worked for me :-)
You simply remove ONLY the javascript in the input field using firebug. and save it.
but even though my linksys router have saved the broadcasting ip which ends with 255, I cant wake my computer from WAN. I can do with LAN perfectly but not WAN
my software seems to check it on the html page and on some server page... i can send it 255, but it sais unsuccessful, any ideas?
My backup file was encrypted, disabling JS was not useful, and using DOM to force the 255 failed. Thus, if you are using firebug or any java editor, first edit the blur rule for the input blank to allow 255 then you need to edit the script that runs when you press the save settings button. change submitF(this.page) to submit(this.page) and then pressing the button will just make the setting save vs checking to make sure the settings are valid before saving.
-Juiceyman
Post a Comment