Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hi Everyone, This is going to be an easy one! (hopefully) With my Win32 version on netcat (nc.exe) I can do the following... (No windoze comments please!) nc -u 192.168.1.255 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Posts
    17

    netcat - UDP Broadcast


    Hi Everyone,

    This is going to be an easy one! (hopefully)

    With my Win32 version on netcat (nc.exe) I can do the following...
    (No windoze comments please!)

    nc -u 192.168.1.255 9999

    This broadcasts any data over my LAN on UDP 9999.

    I can't manage to achieve the same effect from my Centos (or other) boxes.

    It does nothing and returns me to prompt.

    Can anyone show me how stupid i'm being please?

    Thanks,

    E

  2. #2
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Quote Originally Posted by elluk
    I can't manage to achieve the same effect from my Centos (or other) boxes.

    It does nothing and returns me to prompt.
    How do you know it does nothing? Watch the outbound udp traffic on that box using tcpdump.

    I'm also presuming you've studied the nc manpages to confirm the same options you're trying to use are implemented on CentOS.

  3. #3
    Just Joined!
    Join Date
    Nov 2007
    Posts
    17
    I know it does nothing because I'm already monitoring with a packet sniffer.
    So thanks.

    I have not read the man page (I will do so now).
    However, If the functionality is not supported, I would still like a solution.

    Am I right in thinking you don't know another way of sending data to a broadcast address?

    Can anyone suggest an alternative/fixed method?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Quote Originally Posted by elluk
    Am I right in thinking you don't know another way of sending data to a broadcast address?
    No sir, you are not.

    I don't have access to my CentOS box at the moment. I'll play around with nc and nmap on it later today and see what I find.

  6. #5
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Weird - this isn't working as I'd expected. nc returns to the command line immediately on my CentOS box; probably the same behavior you're seeing. No error, no explanation (but a non-zero return code).

    Code:
    [root@fugu ~]# nc -u 10.0.0.255 9999
    [root@fugu ~]# echo $?
    1
    I tried a few different udp ping combinations using nmap, and that doesn't appear to be the right tool for the job either.

    I haven't had a need to arbitrarily send udp packets to a broadcast address before, so I'm not sure what else to recommend.

  7. #6
    Just Joined!
    Join Date
    Nov 2007
    Posts
    17
    I also have this problem on a slackware distro.
    So I don't think this is a CentOS thing.

    Hopefully someone else will pipe up with a reply.

    I KNEW YOU DIDN'T HAVE THE ANSWER!

  8. #7
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Well, it's a question of incentives. If I can't solve a forum question after a few minutes I move along. It's free advice after all.

    Good luck. Post back once you figure it out.

  9. #8
    Just Joined!
    Join Date
    Nov 2007
    Posts
    17
    Well in that case...

    5$ via paypal for the solution! or anyone else for that matter.

    I'll leave it with you

  10. #9
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    FIVE dollars!!! (Isn't that like 3.50 after paypal tax?)

    Tempting, but I'll pass on that... generous offer. Here's my latest stab at it:
    Code:
    # nmap -PU -P0 10.0.0.255 -p 9999
    Using nmap -- UDP scan, don't bother with ping discovery (which should allow packets to be sent to the broadcast address), port 9999.

    Note the tcpdump packets captured:
    Code:
    fugu# tcpdump port 9999
    ...
    09:50:09.868410 IP fugu.someplace.45585 > 10.0.0.255.9999:...
    09:50:10.868663 IP fugu.someplace.45586 > 10.0.0.255.9999:...
    Ok?

    (This nmap scan was run from a FBSD box, but nmap options should be standard across platforms.)

  11. #10
    Just Joined!
    Join Date
    Nov 2007
    Posts
    17
    Thanks mate.

    No quite what I was after though. I don't think nmap is the right tool for the job really.

    I need the ability to pipe to the stream POSIX styleeee.

    e.g.

    nc -u 10.0.0.255 9999 < /dev/random

    Thanks for trying. I'll keep looking and post if i find anything.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •