Disable Ping Response
What is a ping:
A ping is a simple network utility used to check if a machine is online and to test the network connection.
It sends a small network packet to the target machine. If the machine is up, it responds back with an answer. The time it takes to receive the response is called the ping time or round-trip time.
The ping response from an IP address indicates that the machine is reachable and online.
Why disable ping responses?
Unfortunately, ping responses can be used to quickly scan an IP range and identify reachable hosts. This scanning method could be used by attackers to find potential vulnerabilities or hackable machines.
If your machine does not respond to pings, it reduces its visibility on the network. However, this does not make your machine more secure; it just makes it harder to detect from the internet.
How do I disable the ping response?
To disable ping responses, add the following line to your network init script (the file name will depend on your Linux distribution):
echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all
This command disables ping responses.
Re-enabling Ping Responses
If you wish to re-enable ping responses, run the following command:
echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_all
Making the Change Permanent
To make this change permanent across system reboots, add the following line to the /etc/sysctl.conf
file (if it exists):
net.ipv4.conf.icmp_echo_ignore_all = 1