We're running four computers connected to a hub (yes a hub not a switch) on Fedora 13. They were installed using images from a colleague that has recently left us to go back to school, they may have been set to somehow block the use of the broadcast, but we'd like to continue using this image. We've setup the static IPs for each computer using ifconfig (we've also tried ip addr add) to 10.0.1.11/24 through 10.0.1.14/24, using these settings we can't seem to ping the broadcast which is indeed set correctly to 10.0.1.255, using tcpdump we see nothing except outgoing ping requests from the computer that calls the ping request. Does anyone have any ideas or am I missing something entirely?
Linux Networking – Can’t Ping Broadcast Address
iplinuxnetworkingping
Related Solutions
Sending a single packet and waiting for a response is going to be one of the fastest possible ways, and ping is a fine way to do that. In fact, depending on your use case, I'd argue that it's too fast, since it doesn't really tell you if the system is actually doing anything useful, just that the kernel's network subsystem is alive and configured.
But assuming that's good enough, you can make some improvements. First, you could use -W1
to decrease the ping timeout to one second. Second, you could make your script ping the different hosts asynchronously (in a background thread), and check the results as needed rather than waiting.
Alternately, you can re-think the approach and have the remote systems check in somehow when they're up, and if a system hasn't checked in, you can assume it's down.
I get the same thing, from time to time. It's annoying, and might be caused by interference from other nearby wifi networks.
I fix it by going into the router settings (easier said than done, when it's not working well) and change the wifi channel. There are a number of channels to choose from, numbered from 1 to 11 or 14, or whatever your router happens to support (and local regulation allow) and you can pick whichever you wish. Unfortunately I can't tell you how to find that option on your model, but I'd be surprised if it didn't have one.
If you happen to have an Android phone, you might like to check out the free "Wifi Analyzer" app: it can tell you what channels are least crowded.
EDIT:
Possibility number two is that your machine has a less-well supported wireless chipset/card. I had this too: it seemed to work fine in my old house, but when I moved I had all sorts of trouble, but only with that one machine - the others seemed fine. (It also seemed to run fine when I booted into Windows, but I didn't do that often, so I could be mistaken.) Presumably the difference was that I had changed to a new 802.11n router when I moved (and got a new ISP), whereas the old one had been an ancient 802.11b model; it could also be just simply the construction of the house, or something, causing unfortunate reflections.
I eventually solved the problem by buying an external USB wifi dongle. This also had the advantage of upgrading my laptop from 802.11g to 802.11n to match the router, which was a bonus. You need to make sure it's supported by Linux though, because the drivers that come with it will do you no good; google is your friend.
BTW, my wireless chipset was a broadcom 4312, if I remember correctly.
Best Answer
echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
- as root.You may need to also use the
-b
option with ping and it will most likely require root permissions.