修改配置文件/etc/sysctl.conf

在这个文件的最后添加一行:

net.ipv4.icmp_echo_ignore_all=1
 
(0 代表允许 1 代表禁止)

执行sysctl -p 使新配置生效