Sometimes we need to disable ICMP messages to our servers to prevent some kind of IP flooding and denial of service attacks.
We can prevent Ping request to our servers in two ways:
1. Please run the following command to disable ping request to our server:
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all
2. We can also do the same using IPtables.
iptables -A INPUT -p icmp -j DROP
Now you have disabled ping request to our server.