{"id":1939,"date":"2017-08-15T09:09:59","date_gmt":"2017-08-15T03:39:59","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=1939"},"modified":"2026-09-02T19:23:30","modified_gmt":"2026-09-02T13:53:30","slug":"disable-ping-icmp-replies-ubuntu-server-16-04-2-permanently","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/disable-ping-icmp-replies-ubuntu-server-16-04-2-permanently\/","title":{"rendered":"How to Disable PING (ICMP Echo Replies) on Ubuntu Server 16.04.2"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p class=\"isSelectedEnd\">PING is a commonly used network diagnostic tool that relies on ICMP (Internet Control Message Protocol) echo requests and replies to verify network connectivity between systems. While PING is useful for troubleshooting, some administrators choose to disable ICMP echo replies on production servers to reduce unnecessary network visibility and limit certain types of network reconnaissance.<\/p>\n<p class=\"isSelectedEnd\">Disabling ICMP responses can be beneficial in environments where security hardening is required or where administrators want to reduce the impact of excessive ICMP traffic.<\/p>\n<h3>Common Reasons to Disable ICMP Replies<\/h3>\n<ul data-spread=\"false\">\n<li>Improve server security by reducing network exposure.<\/li>\n<li>Prevent automated network discovery and scanning.<\/li>\n<li>Reduce unnecessary ICMP traffic.<\/li>\n<li>Mitigate network flooding attempts using commands such as <code dir=\"ltr\">ping -f<\/code>.<\/li>\n<li>Comply with specific organizational security policies.<\/li>\n<\/ul>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Prerequisites<\/h2>\n<ul data-spread=\"false\">\n<li>Ubuntu Server 16.04.2<\/li>\n<li>Root or sudo access to the server<\/li>\n<\/ul>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Disable PING (ICMP Echo Replies) Permanently<\/h2>\n<h3>Step 1: Edit the sysctl Configuration File<\/h3>\n<p class=\"isSelectedEnd\">Open the system kernel parameter configuration file:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">vi \/etc\/sysctl.conf<\/code><\/pre>\n<p class=\"isSelectedEnd\">Add the following line at the end of the file:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">net.ipv4.icmp_echo_ignore_all = 1<\/code><\/pre>\n<p class=\"isSelectedEnd\">Save the file and exit the editor.<\/p>\n<h3>Step 2: Apply the Changes<\/h3>\n<p class=\"isSelectedEnd\">To immediately load and apply the new kernel parameter, run:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">sysctl -p<\/code><\/pre>\n<p class=\"isSelectedEnd\">You should see output similar to:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">net.ipv4.icmp_echo_ignore_all = 1<\/code><\/pre>\n<p class=\"isSelectedEnd\">This confirms that the configuration has been successfully applied.<\/p>\n<h3>Step 3: Verify the Configuration<\/h3>\n<p class=\"isSelectedEnd\">You can verify the current setting by running:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">sysctl net.ipv4.icmp_echo_ignore_all<\/code><\/pre>\n<p class=\"isSelectedEnd\">Expected output:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">net.ipv4.icmp_echo_ignore_all = 1<\/code><\/pre>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Testing<\/h2>\n<p class=\"isSelectedEnd\">From another system, attempt to ping the server:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">ping your-server-ip<\/code><\/pre>\n<p class=\"isSelectedEnd\">The client will no longer receive ICMP echo replies and may display messages similar to:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">Request timeout for icmp_seq 0<\/code><\/pre>\n<p class=\"isSelectedEnd\">or<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">100% packet loss<\/code><\/pre>\n<p class=\"isSelectedEnd\">depending on the operating system used for testing.<\/p>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Re-Enable ICMP Replies<\/h2>\n<p class=\"isSelectedEnd\">If you need to restore normal PING functionality, change the value back to:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">net.ipv4.icmp_echo_ignore_all = 0<\/code><\/pre>\n<p class=\"isSelectedEnd\">Then reload the configuration:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">sysctl -p<\/code><\/pre>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Conclusion<\/h2>\n<p>Disabling ICMP echo replies is a simple yet effective security-hardening measure for Ubuntu servers. By modifying a single kernel parameter, administrators can prevent the server from responding to PING requests while keeping all other network services operational. Although this does not make a server completely invisible, it can reduce unnecessary exposure and help meet security requirements in production environments.<\/p>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Frequently Asked Questions (FAQ)<\/h2>\n<h3>1. Does disabling ICMP replies make my server completely invisible?<\/h3>\n<p class=\"isSelectedEnd\">No. Disabling ICMP echo replies only prevents the server from responding to PING requests. Services such as SSH, HTTP, HTTPS, and other open ports can still be detected through network scans.<\/p>\n<h3>2. Will disabling PING affect website availability?<\/h3>\n<p class=\"isSelectedEnd\">No. Your website, APIs, email services, and other applications will continue to function normally. Only ICMP echo requests (PING) will be ignored.<\/p>\n<h3>3. How can I check whether ICMP replies are disabled?<\/h3>\n<p class=\"isSelectedEnd\">Run the following command:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">sysctl net.ipv4.icmp_echo_ignore_all<\/code><\/pre>\n<p class=\"isSelectedEnd\">If the output is:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">net.ipv4.icmp_echo_ignore_all = 1<\/code><\/pre>\n<p class=\"isSelectedEnd\">ICMP echo replies are disabled.<\/p>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2 class=\"markdown__heading\">Related Articles<\/h2>\n<ol class=\"markdown__list\">\n<li><strong><a href=\"https:\/\/pheonixsolutions.com\/blog\/disable-ping-icmp-replies-ubuntu-server-16-04-2-temporarily\/\"><span data-sheets-root=\"1\">How to disable PING or ICMP replies from a Ubuntu Server 16.04.2 Temporarily<\/span><\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/pheonixsolutions.com\/blog\/ssh-setup-newly-installed-ubuntu-16-04-2-server\/\"><span data-sheets-root=\"1\">SSH setup in a newly installed Ubuntu 16.04.2 server<\/span><\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/pheonixsolutions.com\/blog\/add-webmail-alias-vestacp-panel-ubuntu-16-04\/\">Add webmail alias in VestaCP panel &#8211; ubuntu 16.04<\/a><\/strong><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Introduction PING is a commonly used network diagnostic tool that relies on ICMP (Internet Control Message Protocol) echo requests and [&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":[1022],"tags":[274],"class_list":["post-1939","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-ubuntu","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-vh","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1939","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=1939"}],"version-history":[{"count":2,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1939\/revisions"}],"predecessor-version":[{"id":11330,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1939\/revisions\/11330"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}