You are not logged in.

#1 2009-09-09 16:32:02

PingPing
Member
From: /dev/null
Registered: 2009-07-24
Posts: 39
Website

Problem with Wake-On-LAN over internet

I'm having problems trying to wake a PC behind my home firewall from the internet using my laptop.
I'm running a standard Netgear ADSL Modem/Router at home and I've configured packets arriving on port 40000 to pass through its firewall and on to the (internal) IP address 192.168.0.5, which is the fixed, NATed IP given to the PC by my Netgear router.
The PC's BIOS is configure for Wake-On-LAN and I can successfully wake the PC when my laptop is connected to my home network (ie. when the laptop is on the LAN).
However, when I'm outside of my LAN (eg. on the internet) and I try:

$ wol -i XX.XX.XXX.XXX AA:BB:CC:DD:EE:FF

(where XX.XX.XXX.XXX is the fixed IP address for my router and AA:BB:CC:DD:EE:FF is the MAC address of the PC's NIC) it doesn't work.
All this has got me thinking 'how can the router know where my PC is if it isn't switched on and (therefore) hasn't asked for it's (192.168.0.5) IP address anyway?  The packets coming through the firewall don't seem to be being broadcast by the Netgear router to every machine on the LAN.'

Am I doing something wrong?

Last edited by PingPing (2009-09-09 16:36:11)

Offline

#2 2009-09-09 17:46:48

Boris Bolgradov
Member
From: Bulgaria
Registered: 2008-07-27
Posts: 185

Re: Problem with Wake-On-LAN over internet

Did you try to specify the UDP port ?
wol -i <ip> -p 40000 <mac>

Offline

#3 2009-09-10 19:56:38

PingPing
Member
From: /dev/null
Registered: 2009-07-24
Posts: 39
Website

Re: Problem with Wake-On-LAN over internet

Thanks.  Even that didn't work.  Well, it did - I'm getting a patchy response.  Sometimes it works, sometimes it doesn't and I don't know why.

Offline

#4 2009-09-10 20:33:20

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Problem with Wake-On-LAN over internet

What WoL does is sending a special packet to *all* systems in the network, containing the MAC address of the destination system. I think all the IP address does is tell the box that, upon boot, it should ask the DHCP server for that address. That's all I can think of.

So the IP is irrelevant for the WoL procedure on itself, it relies on the MAC address of the network interface of the system you're trying to wake up.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#5 2009-09-10 22:45:44

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: Problem with Wake-On-LAN over internet

B wrote:

What WoL does is sending a special packet to *all* systems in the network, containing the MAC address of the destination system. I think all the IP address does is tell the box that, upon boot, it should ask the DHCP server for that address. That's all I can think of.

The IP address is the 'broadcast' address to use - 255.255.255.255 by default, but changing it causes a unicast packet to be sent instead. The router configured with the port forward will receive it and forward it on, however I believe it should forward it to 255.255.255.255 rather than the internal IP address of the machine you want to wake up (since when it's turned off, it doesn't know about it's IP address).

That's my understanding anyway...

Offline

#6 2009-09-11 01:08:25

piezoelectric
Member
Registered: 2009-09-08
Posts: 48

Re: Problem with Wake-On-LAN over internet

What you are doing wrong, is forwarding to a specific IP address.  When your computer is off/suspended it doesn't have an IP address.  Assuming that your netmask is 255.255.255.0 (so your network is 192.168.0.*), you need to forward 40000 to either 255.255.255.255 or 192.168.0.255 (personally, I prefer that latter).

The biggest problem is that most routers don't allow you to forward to a broadcast address. Here's my trick to getting around this. If your router allows you to SSH or Telnet into it, do so. Then drop to a shell (simply by typing 'shell', usually). Then run the command:

arp -s 192.168.0.254 ff:ff:ff:ff:ff:ff

This will effectively make .254 the broadcast address. So go ahead and forward port 40000 to 192.168.0.254 port 9, and you should be good to go.

Offline

#7 2009-09-11 10:52:25

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Problem with Wake-On-LAN over internet

fukawi2 wrote:
B wrote:

What WoL does is sending a special packet to *all* systems in the network, containing the MAC address of the destination system. I think all the IP address does is tell the box that, upon boot, it should ask the DHCP server for that address. That's all I can think of.

The IP address is the 'broadcast' address to use - 255.255.255.255 by default, but changing it causes a unicast packet to be sent instead. The router configured with the port forward will receive it and forward it on, however I believe it should forward it to 255.255.255.255 rather than the internal IP address of the machine you want to wake up (since when it's turned off, it doesn't know about it's IP address).

That's my understanding anyway...

You might very well be correct about the IP address tongue.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB