How to Disable Ping on a Linux VPS IP

When we use shared hosting, after pinging some hosting providers’ product IPs, we may see the result as “timed out.” For security reasons, some hosting providers disable ping test data, though most still allow ping. When we manage our own Linux
VPS hosting products, we can freely decide whether to disable ping for our VPS product
IP.

The first method is to modify the file:

/proc/sys/net/ipv4/icmp_echo_ignore_all

Edit this file. By default it should be 0; changing it to 1 will disable
PING. If you need to restore it, change it back to 0, then restart the VPS.
The second method is to solve it directly with commands:

sysctl -w net.ipv4.icmp_echo_ignore_all=1
sysctl -p

Command to disable it.

sysctl -w net.ipv4.icmp_echo_ignore_all=0
sysctl -p

Restore it.
Using commands takes effect immediately and does not require restarting the VPS.

Leave a Comment

Your email address will not be published. Required fields are marked *

中文 EN
🚀

RedGate VPN

免费节点太挤太慢?
升级高速稳定专线

立即体验 →

告别卡顿

RedGate VPN
全球高速节点

免费下载 →
Scroll to Top