Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Freebsd as a router.
Local network is on interface sk0: inet netmask 0xffffff00 broadcast
In my local network I have a computer(windows 7) that gets it's ip( from DHCP server on Freebsd.

  • Ping to exact address works fine.

When I try to ping bradcast from Freebsd itself nothing happens:

--- ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
  • #arp -a says:
    ? ( at (incomplete) on sk0 expired [ethernet]

  • Firewall allows all on this interface

Where to look? What to do to make broadcast working?

share|improve this question
up vote 6 down vote accepted

If you want to perform host discovery, don't use broadcast pings, just simply ping each possible permutation for a given subnet. It sounds heavy, but it actually takes seconds (brackets are important):

$ time ( s=192.168.0 ; for i in $(seq 1 254) ; do ( ping -n -c 1 -w 1 $s.$i 1>/dev/null 2>&1 && printf "%-16s %s\n" $s.$i responded ) & done ; wait ; echo )      responded     responded      responded    responded      responded

real    0m1.317s
user    0m0.004s
sys 0m0.084s
share|improve this answer
While it does offer an alternative way to ping the network, it doesn't answer the questions posed as to "why doesn't broadcast ping work?" – Sarge Oct 12 '12 at 21:52
True, but call it pragmatic intuition. I suspected there was an underlying reason as to why this person was trying to broadcast ping the network. I don't see any harm in going beyond the answer to provide a possible solution. ;-) – Craig Oct 12 '12 at 22:48
+1 for telepathy =) – Sergey Jul 30 '13 at 6:40
Or, e.g. nmap -sn (replace with appropriate subnet). – Andrew Marshall Jan 24 '15 at 18:05

Most operating systems simply ignore broadcast ICMP pings by default, for security reasons. You don't "make it work", and it has no effect on other kinds of broadcasts.

On FreeBSD, the net.inet.icmp.bmcastecho sysctl toggles this feature.

share|improve this answer
And on Linux you can enable broadcast pings with: sysctl net.ipv4.icmp_echo_ignore_broadcasts=0 – Andre Miller Nov 11 '12 at 15:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .