以下设置将允许自己往外ping 不允许别人ping自己
vi /etc/sysconfig/iptables 加入如下2条规则 -A INPUT -p icmp --icmp-type 0 -j ACCEPT -A OUTPUT -p icmp --icmp-type 8 -j ACCEPT
重启iptables
service iptables restart