How to enable or disable ping under Debian/Centos

888u

Last update at :2024-07-02,Edit by888u

1. It is actually very simple, modify it under SSH:

vi /etc/sysctl.conf

Uncomment net.ipv4.icmp_echo_ignore_all if it is in the file, and then modify it. If not, add it.

net.ipv4.icmp_echo_ignore_all=0

Indicates that ping is allowed

net.ipv4.icmp_echo_ignore_all=1

Indicates that ping is prohibited

Finally, just restart.

2. Check whether it can be pinged

cat /proc/sys/net/ipv4/icmp_echo_ignore_all

Returning 0 means it is possible, returning 1 means it is not possible.

Recommended site searches: Wanwang domain name space, large bandwidth server rental, which high-defense game server is the best, virtual space host, domain name registration website query, registration center, address check by IP, mainland China virtual host, mainland China free Registration space, domain name registrar,

How to enable or disable ping under Debian/Centos

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码