Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 07-06-2007, 08:14 AM   #1
Registered: Aug 2006
Location: Allahabad,India
Distribution: Fedora Core 5
Posts: 41

Rep: Reputation: 15
ping broadcast doesn't yield reply from all alive hosts on my subnet??

hi all,
i was trying to ping the broadcast address of my subnet n this is the output:
   [root@vijay ~]# ping -b
WARNING: pinging broadcast address
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=255 time=0.442 ms
64 bytes from icmp_seq=1 ttl=255 time=0.483 ms (DUP!)
64 bytes from icmp_seq=1 ttl=64 time=0.989 ms (DUP!)
64 bytes from icmp_seq=1 ttl=255 time=98.5 ms (DUP!)
64 bytes from icmp_seq=2 ttl=64 time=0.215 ms
64 bytes from icmp_seq=2 ttl=255 time=4.82 ms (DUP!)
64 bytes from icmp_seq=2 ttl=255 time=4.87 ms (DUP!)
64 bytes from icmp_seq=2 ttl=255 time=28.4 ms (DUP!)
64 bytes from icmp_seq=3 ttl=64 time=0.217 ms
64 bytes from icmp_seq=3 ttl=255 time=4.34 ms (DUP!)
64 bytes from icmp_seq=3 ttl=255 time=4.39 ms (DUP!)
64 bytes from icmp_seq=3 ttl=255 time=13.0 ms (DUP!)

--- ping statistics ---
3 packets transmitted, 3 received, +9 duplicates, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.215/13.404/98.573/26.810 ms
[root@vijay ~]#
unfortunately,it didn't happen as expected i had to get reply from all hosts those were up right..
this differs from nmap's ping sweep output on my subnet..
here's my ifconfig and routing table:
  [root@vijay ~]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:16:76:4B:9B:0C
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::216:76ff:fe4b:9b0c/64 Scope:Link
          RX packets:29055 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9596 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2988379 (2.8 MiB)  TX bytes:770561 (752.5 KiB)

[root@vijay ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface   U         0 0          0 eth0     U         0 0          0 eth0         UG        0 0          0 eth0
[root@vijay ~]#
plzz help me... i am a networking newbie presently studying broadcasting..
thnx in advance..
Old 07-06-2007, 08:41 AM   #2
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
RFC 1122: Echo Request/Reply: RFC-792

Every host MUST implement an ICMP Echo server function that
receives Echo Requests and sends corresponding Echo Replies.
A host SHOULD also implement an application-layer interface
for sending an Echo Request and receiving an Echo Reply, for
diagnostic purposes.

An ICMP Echo Request destined to an IP broadcast or IP
multicast address MAY be silently discarded.

From linux source:

Originally Posted by net/ipv4/icmp.c
if (rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST)) {
* RFC 1122: An ICMP_ECHO to broadcast MAY be
* silently ignored (we let user decide with a sysctl).
* RFC 1122: An ICMP_TIMESTAMP MAY be silently
* discarded if to broadcast/multicast.
if ((icmph->type == ICMP_ECHO ||
icmph->type == ICMP_TIMESTAMP) &&
sysctl_icmp_echo_ignore_broadcasts) {
goto error;
If it's an icmp_echo to a broadcast and sysctl_ignore=1 then ignore. You could change the sysctl configuration on all hosts so that the last condition allows their kernel to answer:
sudo sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=0
Other interesting documents:
Old 07-06-2007, 08:50 AM   #3
Registered: Aug 2006
Location: Allahabad,India
Distribution: Fedora Core 5
Posts: 41

Original Poster
Rep: Reputation: 15
thnx sir.. this has cleared my doubt..
i have toggled that "sysctl_icmp_echo_ignore_broadcasts" and now the same ping broadcast yeilded reply from another host i.e myself now its clear to me sir..

thanx a lot sir..
Old 07-06-2007, 08:58 AM   #4
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
Actually what happens is this (if I'm not mistaken, I can not check on my LAN)
The ping goes from host A to the host B but this host B doesn't reply.
Meanwhile, when A wanted to send a packet to B, it needs its ARP address.
So simply sending the broadcast ping and displaying the arp cache would have been sufficient:
1)empty the arp cache
you get the cache like this: /usr/sbin/arp -a
you remove the lines one by one: sudo arp -d <host1> ...
2)ping -b
3)display the arp cache, the ones which are not 'incomplete' are alive (or there is a proxy arp inbetween, not very common these days)
/usr/sbin/arp -an (n for numerical only, better)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Keep Alive Ping Script Apollo77 Linux - Networking 8 05-19-2006 12:29 PM
udp broadcast from one subnet to another thru a linux router siva_bhavani Linux - Networking 1 12-30-2004 10:20 AM
Enabling subnet directed broadcast on Linux Router yrraja Linux - Networking 3 07-01-2004 12:27 PM
All network/broadcast pairs for subnet mask? debbo Linux - Networking 1 06-14-2004 04:27 PM
forward broadcast packets to another subnet VultureCulture Linux - Networking 9 10-25-2003 04:14 PM

All times are GMT -5. The time now is 05:49 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration