Android ssh to send WOL package

I want to use WakeOnLAN for my NAS server remotely, but my router blocks WOL packets. I thought I could get around this by ssh'ing to our androidTV box and send a WOL packet from there on the local network. I can ssh on Android TV, but I can’t send a WOL packet. Can I launch an ssh graphical session on Android TV and then use one of the WOL apps in the Play Store? Or can I use the WakeOnLan application from the terminal?

+4
source share
1 answer

I figured out a solution as I tried to achieve the same.

Problem: I need to remotely power on my server at home using the Wake on Lan (WoL) command. For WoL to work reliably, the PC on the local network must be used to send the WoL command, NOT the remote PC. I don’t quite understand the reason, but this has something to do with the router clearing the cache of the ARP table after turning off the device. In our case, the server is turned off, but we want to turn it on. Read more here: https://serverfault.com/questions/161560/how-to-get-wake-on-lan-working/349783#349783

Solution You may have a device on the local network that can send a WoL command to a disconnected server. One way to do this is to have a root Android device running an SSH server. You can remotely log in to your Android device using SSH and then send the WoL command.

Steps i used

Note:

  • The above steps may vary depending on the type of device. Update steps for an Android device, but the same principle can be used on devices other than Android.
  • On Android, you cannot use the wakeonlan command. You must use the ether-wake command. This is because BusyBox does not install wakeonlan .
  • You must have sudo or root privileges to issue the ether-wake command
0
source

All Articles