Unable to ping broadcast address

Solution 1:

I think that the times when operating systems responded to broadcasts pings are long gone. As far as I know every modern operating system ignores those requests as a security measure to avoid broadcast storms.

The default in Linux:

$ sysctl net.ipv4.icmp_echo_ignore_broadcasts
net.ipv4.icmp_echo_ignore_broadcasts = 1

If you want to discover machines you'll have to resort to unicast ping (nmap, ping loop or other means), but note, there can be machines configured to always ignore ping requests.

Solution 2:

It has already been discussed that answering pings to broadcast addresses is not considered good practice anymore. You could alternativly ping the all-host multicast group which uses the IP 224.0.0.1. In theory every multicast capable host should respond to a ping to this IP, but I've heard of hosts not doing so.

For more on multicast addresses read the tldp: http://www.tldp.org/HOWTO/Multicast-HOWTO-2.html

Another option would be to just unicast all IP addresses in your network segment which can easily be achieved by using built-in tools on most systems. I only really know GNU/Linux and MS Windows, so I can only give you examples for those systems.

GNU/Linux

for lastoctet in $(seq 254); do ping -c 1 192.168.0.$lastoctet; done

MS Windows

for /l %i in (1,1,254) do ping -n 1 192.168.0.%i

Not as easy as ping 192.168.0.255 but it does work under most circumstances.