This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

WOL over the Internet

I know this topic has been discussed in the past, however, in each case there has not been an actual detailed solution tabled, only alternative workarounds.

I am wanting to send a WOL packet via my Android smartphone to my home PC.  I have the latest Astaro v8 free running on a dedicated machine.  I can do this successfully for ~60 seconds after the machine is put to sleep but this then fails to work due to the ARP cache entry expiring.  Astaro is setup with a DNAT forwarding port 9 to my PC as it seems that it will not transmit a broadcast via NAT.

There are a number of potential solutions to this problem:
1) Setup a static ARP entry
2) Setup bridging

I am not sure if #1 is possible with Astaro, does anyone know this?

#2 was suggested in a couple of the previous WOL discussions, however I am unsure of the theory of how this would work in conjunction with the existing NAT setup or the repercussions of doing so (in particular with respect to security).  Is anyone able to enlighten me on the details of this particular setup?

Any info would be greatly appreciated.

Cheers,

Sam.


This thread was automatically locked due to age.
  • HA!  I had a thought and actually put my machine to sleep, then tried sending a WOL packet and it worked! [:D]  I think the WOL packet capture utility I was using wasn't picking up the WOL packet when it was redirected to the fake IP for some reason!

    Anyway, an excellent result!  Thank you very much for your persistent assistance with this issue Mario, I really appreciate you going above and beyond the call of duty on this one! [[:)]]

    FYI, I tried setting the MAC address in the static ARP entry to that of my PC's NIC, but my PC didn't respond to a WOL packet, however, I was successful in waking up my PC using a non-standard WOL port, which isn't a guarantee of security of course, but at least makes it a bit harder to exploit this little hole [[:)]]
  • Could you please explain what you did in detail for working this out? I'm looking for exactly the same, but I'm still confused on whats the right way.

    Thanks in advance.
  • Here is a summary of trollvottel's solution:

    Create a file called 'S99wol' in '/etc/init.d/rc3.d/' with the following contents:

    #!/bin/bash

    # At the ASG, create a DNAT for UDP Traffic Port 9 to $DNATDST

    # Configuration
    NIC=eth0 #LAN ethernet card
    DNATDST=10.12.28.2  #Fake IP on your subnet

    # Map traffic going to the fake IP to be broadcasted to the entire LAN
    ip neigh change $DNATDST lladdr ff:ff:ff:ff:ff:ff nud permanent dev $NIC > /dev/null 2>&1
    ip neigh add    $DNATDST lladdr ff:ff:ff:ff:ff:ff nud permanent dev $NIC > /dev/null 2>&1


    ..and then make it executable with:
    chmod u+x S99wol


    You also need to create a DNAT rule:
    Traffic Source: Any
    Traffic Service: UDP Destination Port 9
    Traffic Destination: WAN
    Destination: 'Fake IP'
    Destination Service: UDP Destination Port 9


    Then reboot the firewall, put your machine to sleep, then try sending a WOL packet (using the mac address of the target machine) over the Internet (Note that WOL packets redirected in this way will not be captured by a WOL packet capture utility on the target machine.

    Note that this configuration is a bit of a nasty hack and opens the entire LAN subnet to incoming port 9 UDP traffic, but at the moment, it's the only config which enables you to have a one click WOL over Internet solution.

    Let me know if you have any issues and I'll do my best to assist.
  • Thank you very much for your posting!
    I tried this in my network except for rebooting my firewall (just called the script .\S99wol) and its working fine.

    This workaround or nasty hack as you called it isn't a problem for me because I'm using this to wake up a client in my lan from my wireless (different subnets). So I changed the DNAT rule from "any->udp 9->wan->host to wake up" to "my host in wireless subnet->udp 9->wireless interface->host to wake up". So this host is the only device allowed to send traffic on port 9 udp.

    FYI, I'm using this to wake up a client in my lan via phone call to a wireless/dect router in my wireless which starts a script on specific phone numbers received.

    Thanks for helping me out with this!
  • Sambo, next time please link to or quote my postings instead of copying. This solution is not your effort.
  • Sorry Mario, I was not trying to take credit for your work, I was just summarizing the full solution in one post to assist Gudze with his implementation of it due to the fact that as it previously stood, all the relevant information was scattered throughout multiple posts and it was difficult to follow the final working solution.  I have amended my post to credit you for the solution.
  • Well... this appears to have stopped working (possibly after the 8.3.0.1-3 update).  I've manually checked all the components & setup and it all appears to be in order.  Anyone have any ideas?
  • Anything in the PacketFilter or IPS logs?

    Barry
  • If by 'PacketFilter' you mean 'Firewall', then nothing of interest there.  I turned on initial packet logging and got the following which confirms that the WOL packets are being received by the firewall.

    12:12:43 	Connection using NAT UDP :54828 → :5555 len=130 ttl=55 tos=0x00 srcmac=  dstmac=
    


    Nothing in the IPS logs either.

    BTW, I have tested my PC's WOL internally and it works fine.  I have also tried 2 different applications for sending the WOL packet from the Internet.