Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have such trouble when using ping 127.0.0.1 under root:

ping: icmp open socket: Operation not permitted

What does it mean? When I try ls -l /bin/ping it says:

-rwsr-xr-x 1 root root 30788 Jul 27  2010 /bin/ping

I'm using Debian GNU/Linux 5.0

share|improve this question
add comment

2 Answers 2

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 -X

This 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).

share|improve this answer
    
I have real IP that's why I don't want to open totally computer to world in case of clearing iptables. ifconfig says besides lo: lo:4 Link encap:Local Loopback inet addr:92.xxx.xxx.xxx Mask:255.255.255.255 UP LOOPBACK RUNNING MTU:16436 Metric:1. brctl not found. –  Jackson May 25 '11 at 18:41
    
# iptables --list FATAL: Could not load /lib/modules/2.6.34-vs2.3.0.36.30.4.pre8/modules.dep: No such file or directory iptables v1.4.2: can't initialize iptables table filter': Permission denied (you must be root) –  Jackson May 25 '11 at 18:44
add comment

After few search I found setcap and :

setcap cap_net_raw=ep $(which ping)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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