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.
Parents
  • No, thats why they're called "static". They stick until reboot ;-)
  • Right, figured, but your previous comment confused my poor little brain [[:)]]  I apologize for my ignorance, but I'm a novice when it comes to *nix [[:)]]

    So if I 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
    DNATDST=10.12.28.2  #Fake IP on my subnet

    # Map Traffic going Fake-IP being flooded broadcasted
    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


    It should execute that script on boot automatically and do what I'm wanting it to do?
  • Yes, exactly. But I'd call the script 'S99wol' (uppercase 'S') because that's how all other init scripts are linked like and it may not work otherwise. You also still need to create the mentioned DNAT rule: SRC any, DST WAN (Addr), SERVICE: UDP DST Port 9, translated to DST 'Fake IP' (Addr).

    To wakeup the PC, send the WOL packet containing the MAC address of the PC that should be waken up from any internet host to the WAN IP of the ASG (use dyndns?).
Reply
  • Yes, exactly. But I'd call the script 'S99wol' (uppercase 'S') because that's how all other init scripts are linked like and it may not work otherwise. You also still need to create the mentioned DNAT rule: SRC any, DST WAN (Addr), SERVICE: UDP DST Port 9, translated to DST 'Fake IP' (Addr).

    To wakeup the PC, send the WOL packet containing the MAC address of the PC that should be waken up from any internet host to the WAN IP of the ASG (use dyndns?).
Children
  • Ok, I've set that script up and it executes correctly; an 'ip -d neigh' results in:

    [LAN].30 dev eth1 lladdr 00:0c:29:a8:50:58 DELAY
    [LAN].10 dev eth1 lladdr 00:1b:21:1b:20:73 STALE
    [LAN].33 dev eth1 lladdr 00:1b:21:28:81:e4 REACHABLE
    [WAN].254 dev eth0 lladdr 00:90[:D]0:74:e1:ea REACHABLE
    [LAN].20 dev eth1 lladdr 00:0c:29:3c:2e[:D]0 REACHABLE
    [LAN].32 dev eth1 lladdr ff:ff:ff:ff:ff:ff PERMANENT
    [LAN].202 dev eth1 lladdr 00:21:6b:29:33:52 REACHABLE
    [LAN].100 dev eth1 lladdr 00:1c:10:c3:6b:88 STALE


    The only change I made to the script in my previous post was to change the NIC to eth1 as this is my LAN NIC which I'm assuming is what was intended (I tried with eth0 (WAN) as well but no change.

    I have setup the DNAT rule and it works fine if I direct it to my PC's real IP address, but not if I direct it to the 'fake' IP.  I'm using a WOL packet monitor to test.

    I turned on logging on the DNAT rule but got only the following:

    2011:09:12-17:19:14 PhatWall ulogd[5170]: id="2000" severity="info" sys="SecureNet" sub="packetfilter" name="Packet logged" action="log" fwrule="60021" initf="eth0" srcmac="[Source]:ea" dstmac="[Dest]:57" srcip="[Source].50" dstip="[WAN].1" proto="17" length="130" tos="0x00" prec="0x00" ttl="57" srcport="56781" dstport="9"


    The live firewall log shows the following entry:

    18:28:42 Connection using NAT UDP [Source].229:55988 → [WAN].1:9 len=130 ttl=61 tos=0x00 srcmac=[Source]:ea dstmac=[WAN]:57


    Anyone have any ideas what the problem might be here?
  • Hm. Normally it should work that way - will try today on my Home-ASG.

    The logged packet you posted is only informational, it wasn't dropped. The 'log' checkbox only means 'log initially matching packets', so every initial packet of a connection through the DNAT rule will be logged.
  • I just tried it and for me it works how I described it. Did you forget to tick the 'automatic firewall rule' for the DNAT?

    I used that page to remotely wake my Home PC: http://wakeonlan.me/