1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wake On LAN works from GUI but not LAN client

Discussion in 'Tomato Firmware' started by syousef, Jul 28, 2011.

  1. syousef

    syousef Networkin' Nut Member


    Would appreciate assistance with this issue.

    I have been able to get Wake on LAN working from the GUI. I found that I had to enable broadcast on the firewall before it would. But no matter what I try I can't seem to get a WOL client on one PC to wake the other - and I have tried several - WOL, FusionWOL, and command line clients. The reason I want to do this is so I can easily script a Windows cmd file and shortcut so my wife can easily switch downstairs PC on from upstairs without having to learn about the Tomato GUI.

    Note: I am NOT interested in opening up Wake On LAN on to the Internet. I've found various threads about getting that working by setting up forwarding from an unused IP on the subnet. I tried it, but I couldn't get it to work, and it's not what I'm after

    I've also seen this thread about ether-wake, but again not what I'm after, so I haven't tried it

    Some background about my setup:
    Tomato 1.21
    - yes old version. I'm lazy, don't have time, don't like Internet down, and it's worked well till now
    Router is a WRT54GL
    Connected to the router is a TPLINK DGS1008D gigabit wired switch
    Each PC is then connected to the gigabit switch
    Target PC is running Windows XP SP3
    Triggering PC is running Windows 7 x64
    Using Zonealarm as my firewalls both PCs

    Because I can wake it from the GUI I know that:
    - WOL is set up correctly on the target PC
    - Transmission of magic packet from router (WOL GUI)-> gigabit switch -> PC works
    - Zonealarm is not interfering with receipt WOL magic packet on the target PC

    In this day and age of "green" everything you'd think it would be easier!

    Thanks for reading.

  2. lancethepants

    lancethepants Network Guru Member

    Maybe you could get it going with this combination.

    Setup up a script on the router using this:


    Specifically this part of that page.

    1. In the Initialization script of the firmware (Administration / Scripts / Init tab), type this:
      echo "/usr/bin/ether-wake 01:23:45:67:89:AB" > /tmp/home/root/wakeup-mycomputer.sh
      (change 01:23:45:67:89:AB to the mac address of the computer you want to wake-up)
    2. Save and reboot the router, you should see the file “wakeup-mycomputer.sh” appear in the root home directory when you connect using SSH.
    3. Try it “sh wakeup-mycomputer.sh”
    Then you could setup a batch script to ssh into the router and execute the command.
    This should be a starting point with windows, there's a few good ideas here.
    You may need to setup ssh key authentication for it to be seamless. This also would work over the web though that's not your you're going for.

  3. syousef

    syousef Networkin' Nut Member

    Thanks. That is certainly useful information and I am appreciative. I'm about to take my annual leave so I may persue this. not sure if scripting is going to work seamlessly enough since I don't like exposing passwords.

    A nastier problem I've found is that for my upstairs computers on wireless, the cards and USB sticks I'm using don't support wake on WLAN. I'm not spending a fortune on new cards, so it's a show-stopper as far as starting the upstairs computers go. But starting the downstairs machines from upstairs still might be worth persuing. I'm

    What I'd really like is a way to get standard wake on lan clients working...
  4. lancethepants

    lancethepants Network Guru Member

    I've actually become more interested in this myself, but am having a few quirks. Following the guide in my last link, I'm able to execute remote commands to my web hosting account just fine. When it comes to doing this to my home router, it seems there's two hangups.

    First I used this script to use cygwin to ssh.

    @echo off
    chdir C:\cygwin\bin
    bash --login -i -c "%*"
    Then made a batch script to execute from my desktop
    C:\cygwin\launch.bat ssh user@host -p xxxxx "sh wol.sh"
    I am however running ssh on a non-standard port, and it gets hung up on my "-p xxxxx" command and won't continue. I changed it temporarily to port 22 and removed "-p xxxxx", but then it gets hung up on "sh wol.sh" It appears the space is throwing it off, becuase if I change it too "./wol.sh" it atleast attempts (unsuccessfully) to execute it. What needs to be done differently to get this to work?
  5. lancethepants

    lancethepants Network Guru Member

    OK, so I figured out how to get it working with Tomato. I was actually wrong about the port issue, it wasn't causing the issue at all. It was just the space in "sh wol.sh"

    The syntax that should work is:

    C:\cygwin\launch.bat ssh user@host -p 22 'sh wol.sh'
    Just use single quotes
    You can change the port number to whichever port you use.

    Works like a charm. I just double-click the bat file on my desktop, and it takes care of the rest.
    And it can work either locally, or globally.

    You will have to set up pub/priv key authentication to get this working so that you're not asked for a password each time. If you're on a local machine then there shouldn't be any worry of having the key stolen.

    As far as getting a windows wol client going. From what I remember, just make sure you're broadcasting to your local network's subnet, and you could try udp and tcp, port 7 and port 9 seem to be the common ports. And of course make sure the Mac address of the target computer is correct. It's always been flaky for me, so I've just always done it from the router cli or gui.

Share This Page