添加安全组策略
若想通过本地ping通阿里云服务器,则需要添加如下安全组策略。
-
入方向添加ICMP协议
-
出方向添加ICMP协议
设置客户端对本服务器ping
设置允许客户端对本服务器ping
将icmp_echo_ignore_all的1改成0,即可本地ping或客户端对服务器的ping
[root@jiangxj /]# cat /proc/sys/net/ipv4/icmp_echo_ignore_all
1
[root@jiangxj /]# echo 0 >/proc/sys/net/ipv4/
[root@jiangxj /]# cat /proc/sys/net/ipv4/icmp_echo_ignore_all
0
[root@jiangxj /]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.049 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.050 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.051 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.049 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.049 ms