3

I am trying to broadcast to 192.168.1.255 which is my broadcast address. ifconfig says

eth0      Link encap:Ethernet  HWaddr 50:e5:49:51:0b:cb  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::52e5:49ff:fe51:bcb/64 Scope:Link

but If i do nc -uv 192.168.1.255 9999 it reports

nc: connect to 192.168.1.255 port 9999 (udp) failed: Permission denied

but nc -uv 192.168.0.255 9999 works fine

Neel Basu
  • 12,638
  • 12
  • 82
  • 146

1 Answers1

5

Try using socat instead since some nc tools don't support UDP broadcasting.

echo "HELLO" | socat - UDP4-DATAGRAM:192.168.1.255:9999,broadcast
Igor Hatarist
  • 5,234
  • 2
  • 32
  • 45