I have such trouble when using ping 127.0.0.1 under root:
ping: icmp open socket: Operation not permittedWhat does it mean? When I try ls -l /bin/ping it says:
-rwsr-xr-x 1 root root 30788 Jul 27 2010 /bin/pingI'm using Debian GNU/Linux 5.0
3 Answers
After few search I found setcap and :
setcap cap_net_raw=ep $(which ping) 4 You might have an iptables rule preventing pings from getting to localhost (this is entirely possible with iptables).
The following will clear all iptables rules. Do this cautiously because iptables is used to implement firewalling on Linux, so you are effectively disabling your firewall.
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -XThis could happen if your route table is messed up, I believe, as well. Give us the output of route if the above leads nowhere.
The only other thing I can think of is that you have lo, the localhost "virtual network adapter", involved in some weird bridging configuration with another adapter. But this is highly unlikely (but you can use brctl to check).
This solution worked for me:
sysctl -w net.ipv4.ping_group_range="0 1000"