Jump to content

Wake on Lan (WoL)


Ethan Hunt

Recommended Posts

I'll cut the long story short by saying that my NIC and BIOS are configured to accept WoL. I also confirmed this since WoL works when I send the Magic Packet from another computer on the same LAN.

Problem is that my main idea/need is to power my pc on through the internet.

I was of course supposed to port forward UTP port 7 or 9 or whichever (as seen from various sources online) to allow the magic packet sent through the internet to reach the "inside" of my network. As I understood, the packet needs to be forwarded to the broadcast address of the network since a powered off computer doesn't actually have an IP.

Now, my Linksys doesn't allow me to port forward to an IP ending with *.*.*.255 since it can only accept 1-254. I saw various "fixes" to this online but I decided to take a different road. I just changed the subnet of my network to 255.255.255.128 instead of the old 255.255.255.0. This makes x.x.x.127 my broadcast address and I can port forward to it, which i did.

However, although I believe everything is set up correctly, the packet just doesn't reach the computer in question.

Oh yeah, I also have a dyndns account pointing to the WAN IP of the router so the dynamic IP is not a problem. Anyway, this doesn't work even if I use the actuall IP instead of the DNS entry.

I'm just wondering if anyone out there successfully implemented WoL over the net and can maybe shed some light on my situation because I tried most of the things good ol' google recommended.

Thanks in advance!

Link to comment
Share on other sites

I'll cut the long story short by saying that my NIC and BIOS are configured to accept WoL. I also confirmed this since WoL works when I send the Magic Packet from another computer on the same LAN.

Problem is that my main idea/need is to power my pc on through the internet.

I was of course supposed to port forward UTP port 7 or 9 or whichever (as seen from various sources online) to allow the magic packet sent through the internet to reach the "inside" of my network. As I understood, the packet needs to be forwarded to the broadcast address of the network since a powered off computer doesn't actually have an IP.

Now, my Linksys doesn't allow me to port forward to an IP ending with *.*.*.255 since it can only accept 1-254. I saw various "fixes" to this online but I decided to take a different road. I just changed the subnet of my network to 255.255.255.128 instead of the old 255.255.255.0. This makes x.x.x.127 my broadcast address and I can port forward to it, which i did.

However, although I believe everything is set up correctly, the packet just doesn't reach the computer in question.

Oh yeah, I also have a dyndns account pointing to the WAN IP of the router so the dynamic IP is not a problem. Anyway, this doesn't work even if I use the actuall IP instead of the DNS entry.

I'm just wondering if anyone out there successfully implemented WoL over the net and can maybe shed some light on my situation because I tried most of the things good ol' google recommended.

Thanks in advance!

ok the magic packet should be sent to the mac address of the computer you want to wake not the actual ip address. so you can leave your subnet at the 255.255.255.0 and set the mac address of the computers nic that you want to wake. on port 7

Link to comment
Share on other sites

you mean it should be sent to the mac address right?

lol yes nice catch there thx. just to clarify IT SHOULD BE SENT TO THE MAC ADDRESS.

Link to comment
Share on other sites

Guys, the WoL works with a MAC address alone when you're using it on the same LAN. I'm trying to use it over the internet so I have to send the packed to the IP address of the router so it can reach my network (as I already stated in my previous post). The packet itself contains the MAC address of the computer I'm trying to WoL.

As I read some stuff around, it turns out that the problem is probably caused from the fact that this packet needs to be broadcasted in my network and whichever NIC recognizes the MAC address wakes up. Now, probably, the router doesn't want to broadcast this packet since it may assume it's some sort of DoS attack.

Workarounds? Possible solutions? IDK.

Link to comment
Share on other sites

Guys, the WoL works with a MAC address alone when you're using it on the same LAN. I'm trying to use it over the internet so I have to send the packed to the IP address of the router so it can reach my network (as I already stated in my previous post). The packet itself contains the MAC address of the computer I'm trying to WoL.

As I read some stuff around, it turns out that the problem is probably caused from the fact that this packet needs to be broadcasted in my network and whichever NIC recognizes the MAC address wakes up. Now, probably, the router doesn't want to broadcast this packet since it may assume it's some sort of DoS attack.

Workarounds? Possible solutions? IDK.

ok i see what youre saying. in the routers config there should be wol options so that it can send the packet to specific macs or im not sure how its done as each router is different to setup i usually use this on my dd-wrt firmware routers and is pretty simple to setup. in some cases you might have to make your own magic packet and give it to the router. maybe depending on the options have to set static ip's for the computers on your lan.

Link to comment
Share on other sites

Nah, the official Linksys firmware (interface) doesn't have WoL support (which totaly sux) and Linksys sais that they don't even plan to implement it (lame)... I am going to result to dd-wrt firmware if nothing else works since I saw that quite a few people reccomend it. As for the static IP's, computers on my LAN already have them configured and working.. Still, I don't believe they make much difference since the Magic Packet targets a MAC.

On a different note, dd-wrt is a replacement firmware which needs to be flashed onto the router? Is it a problem to rollback to the original firmware in case I experience problems, since dd-wrt firmware will guarantee no customer support from my ISP.

Thanks for all your replies guys!

EDIT: Seems this router (WAG200G) is not supported by dd-wrt... One more challenge please :)

Link to comment
Share on other sites

I have been using dd-wrt on my Linksys router for a few years now. I have never had any problems and I recommend it to anyone. If you use the default Linksys firmware you are only using a small fraction of your router's capabilities.

And YES, you can always flash back the original Linksys firmware if you needed to (it is available on the Linksys website). But, I don't think that you would ever want to do that.

My current dd-wrt version is: Firmware: DD-WRT v24 (05/20/08) vpn

I have also used WOL for a long time.

In order to WOL any of my machines at home all I have to do is ssh to my router (from anywhere) and then run:

/usr/sbin/wol -i Broadcast_IP_Address MAC_Address

For example:

/usr/sbin/wol -i 192.168.1.255 00:10:B5:74:A2:B3

You can also use the WOL tab of the dd-wrt control panel. But there are security issues if you enable the control panel to be accessed from the Internet. Plus the I find using the Linux wol command a lot easier and quicker.

Link to comment
Share on other sites

Thanks a lot dimitar!

Yeah, I already found some alternatives that are supported by my router and will check those out along with the ones you suggested.

This whole issue I'm having is in my "college apartment", at home I have a WRT54GL which I believe supports dd-wrt quite well.

Which Linksys router model are you using?

Do you (or any of you guys around here) believe that dd-wrt is the best solution as far as replacing firmwares goes, or is it a matter of needs and personal opinions as well since I haven't used a "custom" firmware before?

Thanks a lot!

Link to comment
Share on other sites

DD-WRT is very good, good mix between easy to use and full of features. However i've heard good things about Tomato and openWRT. Last time I checked openWRT was harder to use, lacked a decent gui but was endlessly extensible while Tomato is more web 2.0 than the others, not sure about feature sets.

Link to comment
Share on other sites

Thanks a lot dimitar!

Yeah, I already found some alternatives that are supported by my router and will check those out along with the ones you suggested.

This whole issue I'm having is in my "college apartment", at home I have a WRT54GL which I believe supports dd-wrt quite well.

Which Linksys router model are you using?

Do you (or any of you guys around here) believe that dd-wrt is the best solution as far as replacing firmwares goes, or is it a matter of needs and personal opinions as well since I haven't used a "custom" firmware before?

Thanks a lot!

personally dd-wrt is my favorite, i use it on almost all of my routers, i have a few wrt54g variants a wrt 300N and another one that i cant remember. as well as all my neighbors are now running dd-wrt unknowingly now. ;) ive tried tomato and its "ok" and my last favorite of the three is open wrt. either way yo ugo youll have access to a shit load more features that the linksys firmware locks out. and dd-wrt sports some cool new moves with the wi-viz app.

Link to comment
Share on other sites

I had the same problem in my Linksys router too! Easy fix is to go to the port forwarding page and then in firefox preferences, deactivate javascript. Type in 255 in the port forwarding (udp port 9 ofc) and then activate javascript again before clicking "apply changes" or the button wont work. Then after that use Wireshark to confirm that the pc is indeed receiving the packet (type wol in the filter area). THEN turn off the computer to test if it works. I recommend http://www.dslreports.com/wakeup

Also a good method to troubleshoot WoL is to check that the ethernet interface on the computer has it's LED on when the PC is turned off. For some weird reason my Asus P5Q Pro WoL only works when the PC is in standby :(

Link to comment
Share on other sites

  • 3 months later...

Hi everyone,

I can confirm that you can get a WAG200 to work with Wake on Lan over the internet..it took me two days and countless forums on the internet and digging through source code. Hopefully this helps others get this working

Follow the steps below and you should have Wake On Lan working correctly over the internet on the WAG200.

P.S The Javascript hack above for port forwarding 255 did not work for me on Cisco 1.09 or custom woytekm firmware, so hopefully this method works for you.

-------------------------------------------------------------------------------------------------------------------------------

Set the Wake On Lan PC to a static IP address

1. Set the PC you wish to wake over the internet with a static IP address outside of the DHCP scope. As an example set your PC static IP address to 192.168.1.100 and set the DHCP scope on the router to start from 192.168.1.101.

The DHCP router scope can be changed here http://192.168.1.1/setup.cgi?next_file=Setup.htm.

(Look for the 'starting address' parameter and change this to 192.168.1.101)

-------------------------------------------------------------------------------------------------------------------------------

Upgrade the router firmware

2. Download the excellent woytekm custom firmware available from http://woytekm.googlepages.com/linksyswag200g-eu and upgrade your router firmware at http://192.168.1.1/setup.cgi?next_file=FirmwareUpgrade.htm

Make sure the language in the router configuration is set to english before you upgrade the firmware

-------------------------------------------------------------------------------------------------------------------------------

Connect to the router via SSH using PuTTy

3. Using a program such as PuTTy, open an SSH (port 22) connection to your router at 192.168.1.1, when prompted enter

username: root

password: YourRouterWebAdministratorPassword

(default password is "admin" if you have not changed it)

-------------------------------------------------------------------------------------------------------------------------------

Create filesystem for custom scripts

4. Once logged in to the router via SSH, issue a "make_mtd5" command.

This command will make a minix filesystem on /dev/mtdblock/5 - the space originaly

designed to hold optional language version of the www interface.

-------------------------------------------------------------------------------------------------------------------------------

Enable automounting of file system

5. Enable automounting of the filesystem from the http://192.168.1.1/MySetup.cgi?other webpage of the router. Also enable 'Run rc.local script' and 'Run rc.myfirewall'

Pull the power on the router and reboot, or use the "Hard Reboot" command from administration page in setup menu. If you don't reboot the router, the next step will not work

-------------------------------------------------------------------------------------------------------------------------------

Create static DHCP entry for Wake On Lan PC

6. Next you need to create a static DHCP entry for the Wake On Lan PC at LAN/WLAN interfaces on the MySetup->DHCP page. http://192.168.1.1/MySetup.cgi?DHCP.

Enter the MAC address of the PC network card - to find the MAC address enter ipconfig /all at a command prompt, physical address listed for your network card is the MAC address. (Needs to be in entered the format of xx:xx:xx:xx:xx:xx)

Enter the IP address of the PC, this would be 192.168.1.100 if using the examples above.

Enter a comment such as WakeOnLan and then click 'save my settings'

-------------------------------------------------------------------------------------------------------------------------------

Setup port forwarding for port 9

7. Next you need to forward port 9 to the wake on lan PC. To do this go to Applications and Gaming > Single Port Forwarding. http://192.168.1.1/setup.cgi?next_file=SingleForwarding.htm

Create a new port forward using the following information

Application: WakeOnLan

External Port: 9

Internal Port: 9

Protocol: UDP (not TCP!)

IP address: 192.168.1.100

'Enabled' option needs to be ticked

Click 'save settings'

-------------------------------------------------------------------------------------------------------------------------------

Wake On Lan testing tool

Your almost there, reboot router again so everything is setup and forwading correctly. Now you need to test the fucntionality, fortunately there is a tool that will allow you to do this, without switching your PC off continously.

Download Wake On Lan Monitor from http://www.depicus.com/wake-on-lan/wake-on-lan-monitor.aspx and run on the PC you wish to switch on over the internet.

Set port to 9, then press the start button. This program is now listening on the local PC for any Wake On Lan requests and will show successful WOL requests in the window.

-------------------------------------------------------------------------------------------------------------------------------

Testing WOL requests from the internet

Now you need to issue a request over the internet to your router, to check that it forwards the WOL request on to your PC. You can do this by visiting http://www.depicus.com/wake-on-lan/woli.aspx

Enter the following information

Your Network Cards Mac Address: This can be the MAC address of the router or PC, you can get the router MAC from http://192.168.1.1/setup.cgi?next_file=Status.htm

Any Computers Ip Number or FQDN: This is the public IP address of the router (or the dyndns domain name you have setup for it). You can get the public IP address at http://192.168.1.1/setup.cgi?next_file=Status.htm or www.whatismyipaddress.com

Your subnet mask: This needs to be 255.255.255.255 (even if your subnet is set to something else such as 255.255.255.0)!

Any port number: 9 (what we set in the single port forwarding earlier)

Press the wake on lan button, and all going well, you will see the request in the Wake On Lan monitor window (running on the PC that will wake from lan).

-------------------------------------------------------------------------------------------------------------------------------

Now that you have successfully recieved a WOL request from the internet to your PC, you now need to make sure your BIOS and network card are enabled for wake on lan. A good resource on this http://www.annoyances.org/exec/show/article04-101

Shut down the PC and then issue the wake up command from the internet again, it should wake up and begin booting within 2-5 seconds

Good luck

Link to comment
Share on other sites

  • 3 weeks later...

I installed the WAG200G_V1.01.06.wm-build-0.9-A.img file from the site. Opened SSH with PuTTy and run make_mtd5 command, but after the creation, there was an error which I didn't write down. Then I tried to re-execute make_mtd5, but I get :

=============

wag200g:~#make_mtd5

This command will ERASE your /dev/mtdblock/5 flash partition.

This partition is normally used for the different language versions

of the WWW management interface.

Do you want to continue ? (y/n):

y

Checking for mounted partitions ...

Checking for old minix filesystem on /dev/mtdblock/5 ...

ERROR: You already have a minix filesystem on /dev/mtdblock/5 !

The filesystem will not be created. Goodbye.

================

Probably the filesystem creation went ok, but something else happened.

Anyway, as NOT being a Linux guy, I'd like some step-by-step help in order to utilize the existing partition, or to recreate it, because I still can't access MySetup.cgi?other page. I get "page not found" even when I simply click "MySetup" from the router's Web GUI. How can I make it again from the begining? Also when do I need to reboot in the whole procedure?

Even when I reset the router/install the official 1.01.09 and back again the WAG200G_V1.01.06.wm-build-0.9-A.img firmware, the "badly" created filesystem is still in place.

I must add that I still have Internet connection and I still can open SSH from PuTTy. I don't know what to do next.

Heeelp....

TIA

Iordanis

Link to comment
Share on other sites

  • 2 weeks later...

I have a better - and more secure - solution: install DD-WRT (I'm using v24-sp2 build 12533) on your router, and enable PPTP server. Then you can connect remotely to the VPN and access the router's web interface when you want to wake up one of your hosts.

After installing DD-WRT just go to Services/VPN and enable PPTP Server and give user/password. After go to Administration/WOL and configure the hosts you want to have on the wake-up list. Presto. You now have a clean and secure way to wake-up your hosts remotely.

As an added bonus, if you have an iPhone you can easily configure it to connect to the VPN. This will work out-of-box, just give the IP address or the DynDNS hostname, and then access the router's web interface on Safari. You can even create a Safari bookmark so you don't need to type the address ;)

DD-WRT forums are great and can give you any support if you need. If your router doesn't support DD-WRT, you can also buy a WRT-54G for less than 25 bucks on ebay..

Hope this helps.

Link to comment
Share on other sites

ok.. its working now.... the magic packet are being created by xbmc python....

import socket

s=socket.socketsocket.af_inet, socket.sock_dgram

s.setsockoptsocket.sol_socket, socket.so_broadcast, 1

s.sendtoxff6x00x50x2cx01x99x5216, "255.255.255.255",9

searching on internet, ive founded that i need to declare the sockets options before sending a packet to a broadcast address. now its working just copy the script and change the mac address 00 50 2c 01 99 52 with the one of your network board.

you will need to be sure that your computer supports wake-on-lan. to have sure of this, view your network board features and your motherboard bios.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...