When we netizens use Linux servers, the general host vendors enable PING. For example, we can ping the delay speed of the server. Of course, there are special cases. For example, Alibaba Cloud prohibits PING through security group settings. We can delete the items corresponding to the security group and enable PING. In fact, most of our hosts do not have security groups. If you need to disable and enable PING, you can use the following methods.
First, the PING method is prohibited
1. Temporary prohibition of PING
echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all
Temporary method. If we restart the server, it will be restored to its original state, because we have not set it to the startup item.
2. PERMANENTLY PROHIBITED PING
Edit the "/etc/sysctl. conf" file, and then find the parameter after "net.ipv4.icmp_echo_ignore_all" and change it to 1. If not, let's add a line.
net.ipv4.icmp_echo_ignore_all=1
Then execute "sysctl - p" to take effect.
Second, PING method is allowed
1. Allow PING temporarily
echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_all
2. PERMANENTLY PERMITTED PING
echo net.ipv4.icmp_echo_ignore_all=0 >> /etc/sysctl.conf
Or we can learn to find the file above, change it to 0 parameter, and then execute "sysctl - p" to take effect.
It should be noted here that some ECS vendors can set them directly in the security group, and we do not need to set them in the server configuration file.
Scan the code to follow the official account
Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge