Wake on LAN to specific requests (ports?)

1

Is there any way to customize exactly what wakes up a sleeping PC.

If i tick Enable the network card to wake the computer it will just constantly keep waking randomly over the night.

I need my PC to only wake up when a request comes from either port 21 or 3389.

If i enable "Magic Packet" then nothing seems to wake it up.

Anyone got any ideas as to what i can do ?

Exoon

Posted 2014-02-07T18:42:09.723

Reputation: 185

Answers

1

I don't think there is any easy way to customize that.

Wake on LAN works by sending a "magic packet", which can be any stream of data that somewhere contains FF FF FF FF FF FF FF, followed by sixteen repetitions of the device's MAC address.

Note that processing of the magic packet does not work in the usual way (i.e. parsing packet headers and passing its payload to the next level in the stack) as the target PC at that time does not have a working network stack. Instead, the incoming data is just scanned for the magic string and the device boots as soon as that string is encountered.

Therefore the whole process knows nothing about ports. In order to generate a magic packet, all you need to do is to generate a stream of data which contains the required byte sequence and make sure it goes over the physical wire to which the target device is connected.

If the device sending the magic packet and the device to be woken are separated by a bridge or switch (which is the most common situation nowadays), that usually means ensuring that the packet is a valid Ethernet frame with a destination MAC address of FF:FF:FF:FF:FF:FF (the broadcast address).

There are some tools available that accomplish this. For Linux, one is powerwake; for other OSes you may need to google. Get one of those, instruct it to wake your PC (this requires you to know its MAC address), and it should wake up.

user149408

Posted 2014-02-07T18:42:09.723

Reputation: 778

0

I don't think you can do it.

Magic Packet is UDP broadcast in your lan.
Typically it sent to port 7 or 9 or sometimes 32767.
Since this is pre-defined ports - I don't think You can change them.

I think if You want to keep using this feature You need change ports from the initiating computer: remote port say 32762 -> local port 7.

All routers include a "port forwarding" feature, it allows to forward all incoming (from the Internet) UDP packets (on a specific port) to an internal IP address and port. To forward to the broadcast address of your LAN, simply define a port forwarding rule to the broadcast address of your LAN (ex: 192.168.1.255). The exact procedure depend on your router brand and model and will be described in the manual.

So, in theory we need forward UDP port (e.g.32767) into your desired ports (7 or 9).

Now You need configure Your remote computer use other port when initiation WOL. You see - it's quite complicated.

AKarpun

Posted 2014-02-07T18:42:09.723

Reputation: 96