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,

  1. Security reason.
  2. Avoid network congestion.
  3. Avoid network flood using ping hostname -f

Prerequisites:

  1. Ubuntu Server 16.04.2

Implementation:

Follow the below instructions in order to disable PING or ICMP replies from Ubuntu server permanently,

  1. 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

  2. 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.

Leave a Reply