1.关闭ping请求

sysctl -w net.ipv4.icmp_echo_ignore_all=1
sysctl -p

2.开启ping请求

sysctl -w net.ipv4.icmp_echo_ignore_all=0
sysctl -p