LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Wake on LAN using no special programs (handmade)? (https://www.linuxquestions.org/questions/linux-networking-3/wake-on-lan-using-no-special-programs-handmade-4175411823/)

Sopalajo de Arrierez 06-16-2012 02:00 PM

Wake on LAN using no special programs (handmade)?
 
Hello, Friends:
I am trying to build a Wake on LAN packet "manually", this is: whithout any tool intended for that. Or, at least, using the most simple method possible.
Purpose: sometimes I am managing a computer or a device (router, for example) with Linux inside, but with few chances to install my preferred programs, and I wanna wake up another computer on the same LAN. So, as the Magic Packet is has an easy syntax, I am wondering using something simpler, something like:

Code:

echo [MagicPacketForSpecificMAC] | /dev/eth0
or similar.
I have checked the Wake on LAN's Magic Packet specifications (Wikipedia):

Quote:

«The magic packet is a broadcast frame containing anywhere within its payload 6 bytes of all 255 (FF FF FF FF FF FF in hexadecimal), followed by sixteen repetitions of the target computer's 48-bit MAC address, for a total of 102 bytes.»
Assuming 11.22:33:44:55:66 is the destination MAC, what would be the best (the most standard, using program/s found in most Linux distributions, or at least at BusyBox) and more compatible (portable through platforms, maybe even Android) way to do this?

Thanks you all.

jefro 06-16-2012 02:24 PM

It can't get any easier that the magic packet example you have for wol.

http://linux.die.net/man/8/ether-wake

http://linux.die.net/man/1/wol

Might have to make a static arp for that mac address in some cases if you want to use ip addresses.


Many examples on the web for similar tasks. http://www.unix.com/shell-programmin...an-script.html

Sopalajo de Arrierez 06-16-2012 05:46 PM

And without special programs?
 
Quote:

Originally Posted by jefro (Post 4705045)
It can't get any easier that the magic packet example you have for wol.

http://linux.die.net/man/8/ether-wake

http://linux.die.net/man/1/wol

Yes, but "ether-wake" and "wol" are two special programs designed for this job. I wonder if this could be done using usual shell commands.
There are many cases for not using special programs: maybe you are inside a router where you can not upload files nor install programs, or you are logged in a Linux shell with very few privileges, or working with any small Linux embedded device. So you have no possibilities to install "wol", but you can use more standard commands.

Quote:

Originally Posted by jefro (Post 4705045)
Many examples on the web for similar tasks. http://www.unix.com/shell-programmin...an-script.html

The example you are refering to in this thread is in Python. Same case as before: the Linux machine could easily have no Python installed.

michaelk 06-17-2012 07:49 PM

busybox does have ether-wake but your device may not have it built in. http://www.busybox.net/BusyBox.html

AFAIK there are no simple bash commands to send data over ethernet required for wake on lan.

Sopalajo de Arrierez 06-23-2012 09:10 AM

Hope it will be enough.
 
Quote:

Originally Posted by michaelk (Post 4705728)
busybox does have ether-wake but your device may not have it built in. http://www.busybox.net/BusyBox.html

AFAIK there are no simple bash commands to send data over ethernet required for wake on lan.

Well, at least BusyBox is able to be installed in many linux devices.
Thanks for answering.


All times are GMT -5. The time now is 02:42 AM.