7

I am using Ubuntu 16.04 for my OS system.

I'm trying to set the wake on lan with IP Address.

For my previously method, I can do it with MAC address(HWaddr) in local network area.

But now I want to wake up my computer from other place(with global network).

How can I do it?

Is it possible to set with IP Address?

Tsung-Li Wang
  • 451
  • 1
  • 4
  • 9
  • 2
    No, it is not possible. You need to have access to at least one computer (or router) on the LAN, and send the wake-up `arp` package from that. – hschou Nov 08 '17 at 07:46
  • 1
    Basically, you `ssh` into a system on the same local network as your server to wake and use the MAC address to wake it. Your server that is "sleeping" does not have an IP address! – thecarpy Nov 08 '17 at 07:50
  • 1
    If you have an analog modem you can use wake on ring/wake on modem feature so you can turn on remotely your computer by doing a phone call. – Zumo de Vidrio Nov 08 '17 at 08:19
  • @hschou But for windows it can wake with IP Address. Is that you mean I have to connect a router to public network and send the wake-up `arp` package from the router? – Tsung-Li Wang Nov 08 '17 at 08:35
  • @thecarpy I've found a website said how to wake on lan over internet. https://ubuntuforums.org/showthread.php?t=1570275 Is this set with the IP Address? – Tsung-Li Wang Nov 08 '17 at 08:36
  • @Tsung-Li Wang Great, however, they are tricking the router with `Add a static ARP entry.` What I mean is that the sleeping computer is NOT accessible via an IP address, only via MAC address. The router in this case will access the sleeping computer via MAC address. – thecarpy Nov 08 '17 at 08:43
  • @thecarpy It can use `wakeonlan -i 12.345.67.890 01:23:45:67:89:ab` to wake the computer. Did I misunderstand his meaning? – Tsung-Li Wang Nov 08 '17 at 08:44
  • @thecarpy So it's mean that I need to `Add a static ARP entry.` to my wifi router? What the website mean is we need to wake the sleeping computer(unit1) up with MAC and send the wakeolan to the computer(unit1)? – Tsung-Li Wang Nov 08 '17 at 08:47
  • Basically, the website says: Implement port forwarding on router setup static ARP entry on router (to either the IP of computer to wake or broadcast ...good luck with that, no personal wifi routers I know of allow that without OpenWRT) – thecarpy Nov 08 '17 at 09:28
  • @Tsung-LiWang Do you have access to your router? Can you install and wol on the router? Then you can use the setup mentioned in ubuntuforum. Note that the guide is "incomplete" - it does not work. WOL sends arp package and you can not send them over internet (wan). arp is for LAN only. – hschou Nov 08 '17 at 09:32
  • You mean wake on wan WOW? – GAD3R Nov 08 '17 at 10:38
  • @thecarpy Yesterday I tried to use this commend `wakeonlan -i [MAC Address]` to wake my computer up and it works. But if I using this commend `wakeonlan -i [IP Address] [MAC Address]` and it will not work. Why it cannot work? – Tsung-Li Wang Nov 09 '17 at 01:27
  • There is some information how to do this on the [Arch Linux wiki](https://wiki.archlinux.org/title/Wake-on-LAN#Across_the_internet). However, it's pretty much what @thecarpy said in their answer. – clonejo Jul 19 '22 at 14:12

1 Answers1

3

Assuming you have a Linux system on the local network that is up and running.

You use systemd socket to listen on a port that executes a shell script to wake the other, ideally, you could check that the request contains a certain string to prevent script kiddies from waking your sleeping computer. You forward a port on your router to your Linux system that is up.

Just opening a connection to your router on the specified port sending the specified string will start your sleeping Linux computer.

Another option, as the op has seen, is to configure your router to do the job. In my experience, wifi routers do not allow you to add static ARP entries. You could try OpenWRT, which is great, however, flashing your router with OpenWRT just for this is, I think, overkill. Then again, OpenWRT is really good and worth the effort, especially from a security stand point (you can patch the router when you see fit without having to wait for the vendor to release a patch)! All this, provided OpenWRT supports your router.

thecarpy
  • 3,885
  • 1
  • 16
  • 35
  • 1
    Now I have a solution for this. I could use the commend `wakeonlan -i [IP Address] [MAC Address]` to wake my machine.Before that, I have to send arp `arp -a [IP Address]` to the machine from my local machine.But I still have question here.If I've got a machine locate at L.A. and the other machine locate at New York.Is that possible to wake the machine located at L.A. from New York by `wakeonlan`? – Tsung-Li Wang Nov 09 '17 at 06:46