
{"id":295,"date":"2013-07-05T07:18:42","date_gmt":"2013-07-05T07:18:42","guid":{"rendered":"http:\/\/ubuntuhandbook.org\/?p=295"},"modified":"2024-04-21T13:12:35","modified_gmt":"2024-04-21T13:12:35","slug":"disable-ping-response-ubuntu-server","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2013\/07\/disable-ping-response-ubuntu-server\/","title":{"rendered":"How to Disable Ping Response on Ubuntu Server"},"content":{"rendered":"<p>This simple and brief tutorial is going to show you how to disable ping response on Ubuntu Server to make it more secure.<\/p>\n<p>To get started, you need to first run command below to get the root privilege:<\/p>\n<pre>sudo su<\/pre>\n<p>Then, you can disable ping for IPv4 using the command below to set config file value to 1:<\/p>\n<pre>echo  1  &gt; \/proc\/sys\/net\/ipv4\/icmp_echo_ignore_all<\/pre>\n<p>For IPv6, you may use the command below instead:<\/p>\n<pre>echo 1 &gt; \/proc\/sys\/net\/ipv6\/icmp\/echo_ignore_all<\/pre>\n<p>Or, you can use <code>iptables<\/code> command instead to do the same job. Though, you need to replace <b>eth0<\/b> to yours network interface name (run <code>ip -4 address<\/code> to tell).<\/p>\n<pre>iptables  -I  INPUT  -i  eth0  -p   icmp  -s  0\/0  -d  0\/0   -j  DROP<\/pre>\n<p>To re-enable ping response, use commands:<\/p>\n<pre>echo  0  &gt; \/proc\/sys\/net\/ipv4\/icmp_echo_ignore_all<\/pre>\n<pre>echo 1 &gt; \/proc\/sys\/net\/ipv6\/icmp\/echo_ignore_all<\/pre>\n<p>or<\/p>\n<pre>iptables  -I  INPUT  -i  eth0  -p   icmp  -s  0\/0  -d  0\/0   -j  ACCEPT<\/pre>\n<p>To make it permanently, edit the &#8220;\/etc\/sysctl.conf&#8221; file and add the link below, so that the setting gets picked up at boot time.<\/p>\n<pre>net.ipv4.icmp_echo_ignore_all=1<\/pre>","protected":false},"excerpt":{"rendered":"<p>This simple and brief tutorial is going to show you how to disable ping response on Ubuntu Server to make it more secure. To get started, you need to first run command below to get the root privilege: sudo su Then, you can disable ping for IPv4 using the command below to set config file [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,1],"tags":[44],"class_list":["post-295","post","type-post","status-publish","format-standard","hentry","category-howtos","category-ubuntu-server-2","tag-disable-ping-response"],"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=295"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/295\/revisions"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}