LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   WOL - Send Magic Packet (https://www.linuxquestions.org/questions/linux-newbie-8/wol-send-magic-packet-872346/)

GanX 04-01-2011 05:35 AM

WOL - Send Magic Packet
 
Dear Linux God’s! ;)

As i am posting in this forum you might already have guessed that I am a total linux noob, but I am a pretty faster learner. I know a few basic things but I feel like I am stuck with my problem.

I want to send the Magic packet (wake on LAN) from my linux machine to another, but I am unsure how to approach this. I have google’ed my ass off :) but I am none the wiser. I found a few forums posts and programs that can do the trick and guides in how to use the programs but I have no idea how to install them.

You have to know that my linux machine is a NAS server and has therefore only Konsole access (no GUI). As I said before I am pretty much a noob at this so I am glad for any help you guys can give me :)

Here are two links that I have been looking at.

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

http://wiki.tcl.tk/15423

Thank you for your time and help!

GanX 04-01-2011 06:46 AM

I have a follow up question :)

I am trying to make sense of the guide I have linked below.
I have downloaded the udp.kit file but I am totally blank on what to do with it.


http://wiki.tcl.tk/15423

thund3rstruck 04-01-2011 07:46 AM

Quote:

Originally Posted by GanX (Post 4310593)
I have a follow up question :)
I am trying to make sense of the guide I have linked below.
I have downloaded the udp.kit file but I am totally blank on what to do with it.
http://wiki.tcl.tk/15423

To run tcl/tk scripts in linux you use the tclsh interpreter. The tclUDP module adds 'UDP' protocol functions into the tcl language. Put the udp.kit file in any folder in your path:

Code:

echo "$PATH"
Then make it executable:
Code:

chmod +x <path/to/udp.kit>
Now you should be able to use tclsh to run your script and it should work.

Good luck!

arizonagroovejet 04-01-2011 07:57 AM

Look in the repositories for what ever version of Linux you are using. There is probably a package called wol. Install that. Then use

Code:

$ wol macaddress

michaelk 04-01-2011 08:10 AM

Welcome to LinuxQuestions
The basic steps are:
1. Activate WOL in the BIOS.
2. Turn on WOL for your adapter using ethtool utility

There are various methods to automatically configure the adapter to turn on wake on LAN:
http://www.linuxquestions.org/questi...l-work-712283/

There are many apps that send magic packets. wol, wakeonlan are the ones I use. If using the tcl script from the posted link you should use the broadcast address of your network.

GanX 04-01-2011 10:27 AM

Thanks guys i will give it a try as soon as i get home :)

Quote:

Originally Posted by michaelk (Post 4310674)
Welcome to LinuxQuestions
The basic steps are:
1. Activate WOL in the BIOS.
2. Turn on WOL for your adapter using ethtool utility

There are various methods to automatically configure the adapter to turn on wake on LAN:
http://www.linuxquestions.org/questi...l-work-712283/

There are many apps that send magic packets. wol, wakeonlan are the ones I use. If using the tcl script from the posted link you should use the broadcast address of your network.

I do know how to configure the adapter to WOL. Actually i have already used the function but only from another Windows computer. The thing is that i have a NAS server(Linux) at home that is running 24/7 and I would like to use it to turn on my workstation so i can use Remote Desktop to access it. But due to my limited knowledge of Linux I don’t know how ;)

But thanks!

GanX 04-01-2011 12:16 PM

Quote:

Originally Posted by arizonagroovejet (Post 4310659)
Look in the repositories for what ever version of Linux you are using. There is probably a package called wol. Install that. Then use

Code:

$ wol macaddress

I am sorry to say it but i have no idea how to do that, as i said above somewhere i am a total linux noob and i have no idea what im doing. I can get a Windows PC to flush my toilet or make me coffee if want, but you guys are the masters in linux and i am the dumb one (but im ready to learn :D). So if you guys can guide me that would be great!!!

arizonagroovejet 04-01-2011 12:23 PM

Well tell us what version of Linux you're using...

GanX 04-01-2011 12:49 PM

Quote:

Originally Posted by arizonagroovejet (Post 4310919)
Well tell us what version of Linux you're using...

I used a the following command and i hope that's what you want to know ;)

Code:

[~] # cat /proc/version
The output was:

Linux version 2.6.33.2 (root@NasX86-5) (gcc version 4.1.3 20070929 (prerelease)
(Ubuntu 4.1.2-16ubuntu2)) #1 SMP Tue Mar 15 03:58:35 CST 2011

If this is not what you are looking for please let me know so i can find you the right answer, and again thanks for your help and patience!

arizonagroovejet 04-01-2011 12:58 PM

Well it says Ubuntu, so that's enough. I was sort of assuming that you'd just be able to say since you'd remember from when you installed it. Anyway, in Ubuntu the package is called wakeonlan. To install from command line use

Code:

$ sudo apt-get install wakeonlan
The executable is also called wakeonlan

Code:

$ wakeonlan macaddress
You could also install the package, and lots of other packages, using Synaptic Package Manager. Look on the GNOME menus under System > Administration.

GanX 04-02-2011 04:17 AM

Quote:

Originally Posted by arizonagroovejet (Post 4310956)
Well it says Ubuntu, so that's enough. I was sort of assuming that you'd just be able to say since you'd remember from when you installed it. Anyway, in Ubuntu the package is called wakeonlan. To install from command line use

Code:

$ sudo apt-get install wakeonlan
The executable is also called wakeonlan

Code:

$ wakeonlan macaddress
You could also install the package, and lots of other packages, using Synaptic Package Manager. Look on the GNOME menus under System > Administration.


Well i didn’t know what version it is because i didn’t install it, it’s a QNAP NAS server and it of course comes pre-installed. It’s pretty much just a web interface i can access or the konsole of course.

I have tried what you said and i have used the apt-get command before on other linux systems but in this case it doesn’t seem to work. I am pretty sure i saw somewhere that apt-get is also something you can install? (maybe my version of linux doesn’t have it?).

Anyway here is what i did, and what i got in return.

Code:

[~] # sudo apt-get install wakeonlan
-sh: sudo: command not found
[~] #


arizonagroovejet 04-02-2011 05:33 AM

Quote:

Originally Posted by GanX (Post 4311403)
Well i didn’t know what version it is because i didn’t install it, it’s a QNAP NAS server and it of course comes pre-installed. It’s pretty much just a web interface i can access or the konsole of course.

Ah. Well that could make things trickier because it's probably a stripped down customised version of Ubuntu intended to full-fill NAS functionality and little else rather than a regular Ubuntu install. These commands
Code:

$ cat /etc/lsb-release
$ cat /etc/issue
$ cat /etc/issue.net

might reveal what version of Ubuntu was used

Quote:

Originally Posted by GanX (Post 4311403)
Code:

[~] # sudo apt-get install wakeonlan
-sh: sudo: command not found
[~] #


Hmmm. Try this

Code:

$ echo $UID
If that gives you an answer of 0 you're running with root privileges. If that's the case try the command I suggested again but without the sudo. If you're not running with uid 0 try

Code:

$ su -
Then put in your password and if it works, try apt-get again.


Whether you can install anything easily at all depends on whether there are any repos set up to install software from. Which there might not be. You can get a list of repos that are set up using
Code:

$ grep ^deb /etc/apt/sources.list
There might be a neater way than that but I don't know of any, I don't use Ubuntu much.

GanX 04-02-2011 09:35 AM

hmm i didnt have much luck to be honest here is what i found out:

Code:

[~] # echo $UID
0

Code:

[~] # apt-get install wakeonlan
-sh: apt-get: command not found

Code:

[~] # grep ^deb /etc/apt/sources.list
grep: /etc/apt/sources.list: No such file or directory

Code:

$ cat /etc/lsb-release
$ cat /etc/issue
$ cat /etc/issue.net

I didnt get much out of the code above only one of them gave a reply as you can se below. The other two just gave me a " No such file or directory"

Code:

[~] # cat /etc/issue

Welcome to QNAP Systems Inc,. NasX86(10.0.0.10) development environment.


Thanks for not giving up on me :) i hope you still have some tricks up your sleeve ;)

arizonagroovejet 04-02-2011 11:33 AM

Well what you've found it is basically that what you're dealing with is as I suspected a stripped down customised version of Linux that's intended to provide NAS functionality and nothing else. There's mention of Ubuntu in the output you posted before but it's nothing like Ubuntu as you'd by downloading a copy from ubuntu.com. So unless you're already quite skilled in Linux, maybe not even then, there's probably not a lot you can do with it.

With devices that run striped down Linux you can sometimes find a group of people who have hacked them to get extra functionality and such. Try the QNAP website, or Google. You might find someone who has already got a wake on lan client.

The only way I can think of to get a wakeonlan client on there is to copy the relevant binaries over from another machine running a 'proper' version of Ubuntu, but I'm not sure exactly what you'd need to copy over, it depends on what's already on the NAS box.

GanX 04-02-2011 06:02 PM

Quote:

Originally Posted by arizonagroovejet (Post 4311619)
Well what you've found it is basically that what you're dealing with is as I suspected a stripped down customised version of Linux that's intended to provide NAS functionality and nothing else. There's mention of Ubuntu in the output you posted before but it's nothing like Ubuntu as you'd by downloading a copy from ubuntu.com. So unless you're already quite skilled in Linux, maybe not even then, there's probably not a lot you can do with it.

With devices that run striped down Linux you can sometimes find a group of people who have hacked them to get extra functionality and such. Try the QNAP website, or Google. You might find someone who has already got a wake on lan client.

The only way I can think of to get a wakeonlan client on there is to copy the relevant binaries over from another machine running a 'proper' version of Ubuntu, but I'm not sure exactly what you'd need to copy over, it depends on what's already on the NAS box.

I understand. :) I have already posted on the QNAP forums asking if anyone else has attempted this but i haven’t got an answer yet.
I was wondering, the file you are downloading with apt-get is this something I can download “manually” and then copy it over? And as for the idea of doing it on another linux machine, I will try that tomorrow and see what it installs. Maybe I’m lucky and it’s something that’s fairly simple to move.

Thanks for the big effort and if you should remember anything else that might help I would appreciate it allot. Anyway I will let you know how it turns out tomorrow.


All times are GMT -5. The time now is 09:30 AM.