September 16, 2015

Using netcat to send udp broadcast packet

1. You need to be root  on Linux
2. make sure you use the traditional netcat. In Ubuntu, that's nc.traditional
3. to send broadcast to broadcast address port 8080, do this:

       echo -n "hello" | nc -b -u 8080 
4. OR, use ncat:

       echo -n "hello" | ncat -u 8080 

5. OR, use socat:
echo -n "hello" | socat - udp-datagram:,broadcast

No comments:

Post a Comment