linux禁ping(Disable ping response)

本文介绍了如何临时及永久地禁用Linux系统的Ping响应。通过简单的命令操作即可实现,并提供了恢复Ping响应的方法。同时,文章还说明了如何通过配置文件来达到永久禁用的目的。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Disable ping response Temporarily

To disable the PING response, login as root and type the following command

# echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all

To reenable the PING response do this:
# echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_all

Disable ping response Permanently


Edit the /etc/sysctl.conf file and add the following line
net.ipv4.conf.icmp_echo_ignore_all = 1

Execute sysctl -p to enforce this setting immediately
# sysctl -p

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值