How to disable PING or ICMP replies from a Ubuntu Server 16.04.2
How to disable PING or ICMP replies from a Ubuntu Server 16.04.2:
A server admin or an user can disable ping or icmp replies from a server for the following reasons,
- Security reason.
- Avoid network congestion.
- Avoid network flood using ping hostname -f
Prerequisites:
- Ubuntu Server 16.04.2
Implementation:
Follow the below instructions in order to disable PING or ICMP replies from Ubuntu server permanently,
- Edit the sysctl.conf file and add the line
net.ipv4.icmp_ignore_all = 1
In order to edit, from the command line type vi /etc/sysctl.conf
- For immediate effect and enforcement, type the below command,
sysctl -p
you will get the message “net.ipv4.icmp_echo_ignore_all = 1”
Once the policy is enforced you will get response from the host “Request timeout for icmp_seq 0”.
We have now disabled PING and ICMP replies from the server.