How to let CentOS ban ping (anti-PING)

  

often encounters a server that prevents PING, try it

directly under the terminal

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


Extended reading: sysctl sets and displays kernel parameters in the /proc/sys directory. You can use sysctl to set or reset network functions, such as IP forwarding, IP fragment removal, and source routing check. Users only need to edit the /etc/sysctl.conf file to perform functions controlled by sysctl manually or automatically.

sysctl [-n] [-e] -w variable=valuesysctl [-n] [-e] -p (default /etc/sysctl.conf)sysctl [-n] [-e] -a

The meaning of common parameters: -w Temporarily change the value of a specified parameter, such as sysctl -w net.ipv4.ip_forward=1-a Display all system parameters -p Load system parameters from the specified file, If you do not specify it, you can load it from /etc/sysctl.conf. If you just want to temporarily change the value of a system parameter, you can use two methods. For example, you want to enable IP routing and forwarding: 1) #echo 1 > /Proc/sys/net/ipv4/ip_forward2) #sysctl -w net.ipv4.ip_forward=1 Both methods may open the routing function immediately, but if the system is restarted, or the #service network restart command is executed, the value is set. It will be lost. If you want to keep the settings permanently, you can modify the /etc/sysctl.conf file to change net.ipv4.ip_forward=0 to net.ipv4.ip_forward=1

Copyright © Windows knowledge All Rights Reserved