Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Wake on lan/WAN

  1. #1
    Join Date
    Mar 2011
    Beans
    11

    Wake on lan/WAN

    So I configured my ubuntu server to wake on lan using ethtool (with magicpacket)
    Internal it isn't a problem, I just give the command wakeonlan (macaddres) and it turns on.
    But when I try to do it over the internet, it will not turn on.

    I set open port 7 & 9 on my router and it indicates a package is being send to the server. But it still doesn't wake-up. So I tried to see what the wakeonlan command sends, but unfortunately the packet sniffers don't recognise my network card (pc, not server).

    I already tried to google it and went through a lot of pages/fixes but it still doesn't work and I really don't have a clue where to search anymore.

    Hope someone can help!

  2. #2
    Join Date
    Mar 2008
    Location
    Queensland Australia
    Beans
    664
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Wake on lan/WAN

    I copied this from one of the forum requests. Hope it helps.

    Can't get Wake on LAN to work
    I'm trying to get WOL to work on my web server built on an ASUS P4A800D-X motherboard (which supports wol).

    I have it enabled in my BIOS and I've tried several different tools with no results, including my dd-wrt based router which has this functionality built into the firmware.

    All the guides I've read say it has to be enabled in the driver settings in the Windows Control panel before it will work, but I'm running Ubuntu Server 10.04.

    Is there any special steps that must be taken in the OS to enable my web server to power on from the LAN? I've never used this feature before and would like to just shove my web server in a corner some where and have 100% remote control from my main PC.

    Found the solution to my own problem while searching for info on server hibernation.

    Code:

    sudo apt-get install pm-utils ethtool

    Run
    Code:

    sudo ethtool -s eth0 wol g

    and add it to /etc/rc.local to run at boot.

    After running this command my server wakes properly from a powered off state when sending a magic packet.
    regards

  3. #3
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,044
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Wake on lan/WAN

    It's possible that your router has additional security such as Stateful Packet Inspection (SPI) and it simply rejects packets that it doesn't recognize as a valid TCP/IP protocol.

    You could try to install open source firmware on your router such as dd-wrt, I believe it has WOL capability.

    I have set up WOL scripts to wake other machines internally on my network, but that requires me to log into my machine remotely and run the script or set up a script within Drupal if you are running a website for instance.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  4. #4
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,868
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Wake on lan/WAN

    Here is a nice tool for testing.

    http://www.dslreports.com/wakeup

    I once setup WOL on a Linksys WRT54G, I had to change my subnet form 255.255.255.0 to 255.255.255.128. There was something about the broadcast address that would not work otherwise. This may or may not be an issue for you.

    Also on you router port forward you can't forward port 9 to the machine ip you are trying to wake since there is no IP for a sleeping machine. You need to set it to a broadcast address and the machine with matching mac address shall respond.
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  5. #5
    Join Date
    Mar 2011
    Beans
    11

    Re: Wake on lan/WAN

    Thanks for the tips.
    It ultimately took me here: http://www.dslreports.com/forum/rema...nlan~mode=flat

    So I want to wake up internal ip 192.168.2.178. My router is connected at 192.168.2.1, so I send a broadcast at 192.168.2.255.
    Then in theory, it sends a magic packet to all the devices connected to 192.168.2.*

    But commenting on Volkswagner: my subnet from my router is 255.255.248.0 and I can't find a way to change it in my router, so it may be a problem there?

    I tried looking at installing the other firmware, but my router isn't supported, so this is not an option.

    Any other ideas I can try?

  6. #6
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,868
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Wake on lan/WAN

    I will not even pretend to be an expert on subnetting.

    Perhaps you can run an ipconfig on the machine you are waking to verify the broadcast address.

    Code:
    ipconfig
    What model router are you using? I find it strange if you can't change the subnet.
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  7. #7
    Join Date
    Sep 2011
    Location
    London
    Beans
    384

    Re: Wake on lan/WAN

    Quote Originally Posted by lordfreak3012 View Post
    Thanks for the tips.
    It ultimately took me here: http://www.dslreports.com/forum/remark,3806194~root=wakeonlan~mode=flat

    So I want to wake up internal ip 192.168.2.178. My router is connected at 192.168.2.1, so I send a broadcast at 192.168.2.255.
    Then in theory, it sends a magic packet to all the devices connected to 192.168.2.*

    But commenting on Volkswagner: my subnet from my router is 255.255.248.0 and I can't find a way to change it in my router, so it may be a problem there?

    I tried looking at installing the other firmware, but my router isn't supported, so this is not an option.

    Any other ideas I can try?
    Hi ..

    I am as surprised as the others that you can't change your subnet. Nonetheless if you really can't, or choose not to, if your router has a mask 255.255.248.0, then the broadcast address is 192.168.7.255.

    Calculation: 255.255.248.0 is a /21: it's 21 '1's followed by 11 '0's, giving 32 bits.
    The broadcast address is therefore the first 21 bits of the router address 192.168.2.1, followed by 11 '1's, which gives 192.168.0.0 + 0.0.7.255 = 192.168.7.255.

    Be aware that many routers block this kind of directed broadcast. It might be possible to add permanent arp table entries though, where you tell the router that 192.168.2.178 = 12:34:56:78:ab:cd ether address. If that doesn't work on the router, perhaps there's another computer that you can do it from.

    Hope that helps. Let us know if it works.

    Regards,
    Jonathan.

  8. #8
    Join Date
    Mar 2011
    Beans
    11

    Re: Wake on lan/WAN

    Hey guys,

    So after some more searching I was able to change the subnet.
    It was named subnet on my router, thus the confusion.
    The subnet is now set to 255.255.255.128 .
    An ifconfig on the server now tells me it's broadcast address is 192.168.2.127.
    So I portforwarded port 9 to that address, unfortunately with little success.
    I did however find something else on my router called routing.
    So essentialy it says create fixed routes to fixed destinations.

    I can set the IP (I assume this will be the broadcast IP), netmask, gateway and metric (some number) and interface (wan/lan). Maybe I need to set this instead? although I have no idea what the settings should be.

    Thanks for you help so far!

    edit: I also tried turning off SPI with no succes
    Last edited by 6sl7g12xW4; October 7th, 2011 at 08:50 PM. Reason: Forgot something

  9. #9
    Join Date
    Aug 2008
    Location
    Victoria, BC Canada
    Beans
    1,741

    Re: Wake on lan/WAN

    WoL needs a machine that has support in the BIOS and is in standby.

    My old dead IBM used to support it

  10. #10
    Join Date
    Sep 2011
    Location
    London
    Beans
    384

    Re: Wake on lan/WAN

    Quote Originally Posted by lordfreak3012 View Post
    Hey guys,

    So after some more searching I was able to change the subnet.
    It was named subnet on my router, thus the confusion.
    The subnet is now set to 255.255.255.128 .
    An ifconfig on the server now tells me it's broadcast address is 192.168.2.127.
    So I portforwarded port 9 to that address, unfortunately with little success.
    I did however find something else on my router called routing.
    So essentialy it says create fixed routes to fixed destinations.

    I can set the IP (I assume this will be the broadcast IP), netmask, gateway and metric (some number) and interface (wan/lan). Maybe I need to set this instead? although I have no idea what the settings should be.

    Thanks for you help so far!

    edit: I also tried turning off SPI with no succes
    Hi

    Wake on LAN requires you to be able to send a packet to a sleeping machine, either by broadcast (normal method) or a packet to the correct ethernet address, if you can somehow specify that (depends entirely on your router, but it's rare for domestic routers).

    The normal routing table won't help at all because that requires IP addresses, which don't form part of the wake-on-LAN packet. (So I'd ignore the routing table of your router.) Typically the wakeup packet is wrapped in a UDP packet, but but you can't use send it to the victim's IP address as there's no ARP to find the ether addres.

    To test what you've got, may I suggest the following:

    1. Have the server on (the one you want to wake up)
    2. Run tcpdump or wireshark to look at the incoming packets for its own ether address and broadcasts
      Code:
       sudo tcpdump -i eth0 -n -e ether host 11:22:33:44:55:66 or ether broadcast
    3. send it a wakeup packet from a local machine
    4. send it a wakeup packet from a remote machine


    Obviously, as it's already awake, the wake-on-LAN packets won't have any effect, but you will be able tos if it is correctly receiving them. My guess is that your router isn't forwarding them as a broadcast, and step 4 will be silent.

    If there's a suitable function on your router try ping 192.168.2.127 (ie, the broadcast address) and see if that is allowed and shows on your server.

    Hope that's of some use

    Kind regards
    Jonathan.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •