LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-31-2006, 09:48 AM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Question is it possible to make a wake-on-lan with netcat?


I'm trying to use netcat to broadcast a message so that I can wakeup a given host. I have the message in a file I made with hexedit.

I have 6 times FF followed by 16 times the mac address of the host I want to force to wake up written there.

When I try to broadcast that message, netcat won't allow me to.

Here's the output:
Code:
$ cat mensaje.wakeonlan | sudo netcat -v -n -u 192.168.0.255 9
(UNKNOWN) [192.168.0.255] 9 (discard) : Permission denied
$ sudo su
# cat mensaje.wakeonlan | netcat -v -n -u 192.168.0.255 9
(UNKNOWN) [192.168.0.255] 9 (discard) : Permission denied
Any ideas how I can get it done?
 
Old 08-31-2006, 11:05 AM   #2
nuxrl
Member
 
Registered: Jun 2006
Location: NY, USA
Distribution: Slackware, Arch
Posts: 176

Rep: Reputation: 35
Can you try to add a "-b" option in netcat and see if it helps?

Last edited by nuxrl; 08-31-2006 at 11:06 AM.
 
Old 08-31-2006, 11:12 AM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
First: There's no b option in the man page.... however, read next point. ;-)

Second: I just ran it and it effectively sent the broadcast.... but it won't stop running (stays there waiting for somebody to kill it).
 
Old 08-31-2006, 11:35 AM   #4
nuxrl
Member
 
Registered: Jun 2006
Location: NY, USA
Distribution: Slackware, Arch
Posts: 176

Rep: Reputation: 35
This is from
Code:
$man nc
on Slackware 10.2

Quote:
-b allow UDP broadcasts

-r randomize local and remote ports

-s addr local source address

-t enable telnet negotiation
 
Old 06-17-2016, 03:41 PM   #5
Spidergawd
Member
 
Registered: Jun 2016
Location: Cave Johnson's hometown
Distribution: Slackware64-15.0
Posts: 33

Rep: Reputation: Disabled
The magic packet needs to be sent as binary. Pipe first to xxd -r -p before piping to netcat.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wake on LAN DennyB Linux - Hardware 1 08-21-2007 08:27 AM
wake on lan ampena Debian 3 11-16-2005 07:21 AM
wake on lan?? alaios Linux - Hardware 2 08-10-2004 02:04 PM
Wake-on-LAN dARkHunTEr Linux - Hardware 0 11-04-2003 05:17 PM
wake on lan Stex Linux - Networking 7 06-26-2003 12:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration