centos6.2上禁止ping请求

centos6.2下禁止ping请求
根据业务的特殊需求,有些服务器可能禁止外部ping请求。可以使用以下命令来快速实现:

1.关闭ping请求
1  sysctl -w net.ipv4.icmp_echo_ignore_all=1
2  sysctl -p

2.开启ping请求
1  sysctl -w net.ipv4.icmp_echo_ignore_all=0
2  sysctl -p