{"id":1941,"date":"2017-08-15T09:07:53","date_gmt":"2017-08-15T03:37:53","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=1941"},"modified":"2026-09-03T09:29:16","modified_gmt":"2026-09-03T03:59:16","slug":"disable-ping-icmp-replies-ubuntu-server-16-04-2-temporarily","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/disable-ping-icmp-replies-ubuntu-server-16-04-2-temporarily\/","title":{"rendered":"How to disable PING or ICMP replies from a Ubuntu Server 16.04.2 temporarily"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Introduction<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">A server administrator or user may need to disable\u00a0PING or ICMP temporary<strong> replies<\/strong> from an Ubuntu server for several reasons, including:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Security.<\/li>\n\n\n\n<li>Avoiding network congestion.<\/li>\n\n\n\n<li>Preventing network flooding <code>ping hostname -f<\/code>.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">This guide explains how to temporarily disable and re-enable PING or ICMP replies from an Ubuntu Server 16.04.2 using the command line.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Ubuntu Server 16.04.2.<\/li>\n\n\n\n<li>Root or sudo access to the server.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Follow the instructions below to disable PING or ICMP replies from the Ubuntu server temporarily.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Disable PING or ICMP Replies<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">From the command line, run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">echo \"1\" > \/proc\/sys\/net\/ipv4\/icmp_echo_ignore_all<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This temporarily disables ICMP echo replies from the server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Re-enable PING or ICMP Replies<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To re-enable PING and ICMP replies, run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">echo \"0\" > \/proc\/sys\/net\/ipv4\/icmp_echo_ignore_all<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Alternatively, you can reboot the server to restore the setting.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> This configuration is temporary. Once the server is rebooted, the setting will be reset, so you will need to apply it again if required.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Using the <code>\/proc\/sys\/net\/ipv4\/icmp_echo_ignore_all<\/code> setting, you can temporarily disable PING or ICMP replies on Ubuntu Server 16.04.2. Setting the value to <code>1<\/code> disables the replies, while setting it to <code>0<\/code> re-enables them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. How do I temporarily disable ping on Ubuntu?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">echo \"1\" > \/proc\/sys\/net\/ipv4\/icmp_echo_ignore_all<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. How do I enable ping again?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">echo \"0\" > \/proc\/sys\/net\/ipv4\/icmp_echo_ignore_all<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. Will this setting remain after a reboot?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. The setting is temporary and will be reset after the server is rebooted.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Does disabling ping block all network connections?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. This setting specifically disables ICMP echo replies. Other network services, such as SSH, can continue to operate normally.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Why would an administrator disable ICMP replies?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It may be done for security considerations, to reduce unnecessary network traffic, or to avoid certain types of ping-based network flooding.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">SSH Setup in a Newly Installed Ubuntu Server<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Learn how to install OpenSSH Server and establish a remote SSH connection to a newly installed Ubuntu server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/ssh-setup-newly-installed-ubuntu-16-04-2-server\/\">Read the SSH setup guide.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Add Exim Service to Fail2Ban on Ubuntu<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Learn how to configure Fail2Ban to protect the Exim mail service on an Ubuntu server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/add-exim-service-fail2ban-ubuntu\/\">Read the Exim and Fail2Ban guide<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for the right technology solution for your business? Our team of experts can help you with development, cloud, DevOps, design, and a wide range of other technology needs. Get in touch with our team&nbsp;<a href=\"https:\/\/pheonixsolutions.com\/contact\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction A server administrator or user may need to disable\u00a0PING or ICMP temporary replies from an Ubuntu server for several [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1024],"tags":[362,274],"class_list":["post-1941","post","type-post","status-publish","format-standard","hentry","category-security","tag-ping","tag-ubuntu","psol-cat-security"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-vj","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1941"}],"version-history":[{"count":2,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1941\/revisions"}],"predecessor-version":[{"id":11334,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1941\/revisions\/11334"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}