10

I am using Linux. I read somewhere on the internet that pinging the address 255.255.255.255 will ping everyone in the network segment. And it will return every IP addresses in that subnet. But when I tried

ashokkrishna@ashokkrishna-Lenovo-B560:~$ ping -b 255.255.255.255
WARNING: pinging broadcast address
PING 255.255.255.255 (255.255.255.255) 56(84) bytes of data.
64 bytes from 192.168.1.220: icmp_seq=1 ttl=64 time=100 ms
64 bytes from 192.168.1.220: icmp_seq=1 ttl=64 time=100 ms (DUP!)
64 bytes from 192.168.1.220: icmp_seq=2 ttl=64 time=128 ms
64 bytes from 192.168.1.220: icmp_seq=2 ttl=64 time=130 ms (DUP!)

I only get the reply from one IP.

How to get every IP? I know how to get every IP with Nmap but what I read in the internet is totally opposite to my results, why?

Same with

ashokkrishna@ashokkrishna-Lenovo-B560:~$ ping -b 192.168.1.255
WARNING: pinging broadcast address
PING 192.168.1.255 (192.168.1.255) 56(84) bytes of data.
64 bytes from 192.168.1.220: icmp_seq=1 ttl=64 time=55.2 ms
64 bytes from 192.168.1.220: icmp_seq=1 ttl=64 time=66.6 ms (DUP!)
64 bytes from 192.168.1.220: icmp_seq=2 ttl=64 time=78.5 ms
64 bytes from 192.168.1.220: icmp_seq=2 ttl=64 time=79.2 ms (DUP!)
3
  • Interesting note: Windows won't ping that address. Commented Jul 10, 2015 at 20:23
  • superuser.com/questions/717627/unable-to-ping-broadcast-address might be helpful. As Ricky mentioned below, the times of machines responding to broadcasts are long gone. nmap might be a better way to scan the network with unicast pings. However, if you want to test the broadcasts, try it on routers on the same broadcast segment.
    – surya
    Commented Mar 20, 2018 at 5:21
  • I find it odd that you are getting duplicate echo replies. This would indicate a problem on your network of some sort.
    – YLearn
    Commented Mar 20, 2018 at 8:17

6 Answers 6

17

Not all machines will answer a broadcast ping. (all broadcast -- 255.255.255.255, or subnet broadcast -- eg. x.x.x.255) Some see it as a "security feature", because one could spoof the origin to flood any host on the network.

3
  • then above link is saying i could do that.
    – ashok
    Commented Jul 11, 2015 at 7:47
  • 4
    I cannot say it any clearer than the first sentence. There is ZERO certainty that every machine in the broadcast domain will answer. I KNOW, from decades of experience, every machine won't.
    – Ricky
    Commented Jul 11, 2015 at 8:54
3

FOR /L %i IN (1,1,254) DO ping.exe -n 1 -w 500 192.168.1.%i | FIND /i "Reply"

1
  • That will only work for /24 networks. In business, you will find many different network sizes.
    – Ron Maupin
    Commented Sep 25, 2022 at 23:00
2

Try this on all the machines of your network to receive packets from them when pinging the broadcast address

sudo sysctl net.ipv4.icmp_echo_ignore_broadcasts=0
2

Many modern OS have disabled responding to the broadcast. They ignore them to avoid security issues.

If you use Linux, check your settings with:

sysctl net.ipv4.icmp_echo_ignore_broadcasts

If it shows 1, your machine won't answer ping requests sent via a broadcast. You probably won't receive any packets from other machines since they may have similar settings.

Try ARP instead of ICMP to reach out to the machines.

-1

Why do you use the bounds option (-b) ?

Try without this option, it should work unless your router blocks the broadcasted ping requests.

1
  • 4
    '-b' means the address is a broadcast address: -b Allow pinging a broadcast address.
    – Ricky
    Commented Jul 11, 2015 at 1:52
-1

Try pinging 224.0.0.1 it will be replied by all nodes.

1
  • 1
    Welcome to NE, we hope you will both contribute to and learn from this community. You could improve your answer by editing it to add more details to make it more useful both for the original poster and future users. Typically short answers like this could provide reasoning why you believe this is the answer, more explanation about the concepts mentioned, references/links to supporting resources, or applicable examples. In any event, this is simply not a true statement as it stands. Not all hosts (or networks) will accept or respond to multicast traffic.
    – YLearn
    Commented Mar 20, 2018 at 3:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.