View Settings
[Email protected] etc]# Cat/proc/sys/net/ipv4/icmp_echo_ignore_all
0
Test
huangchao-macbookpro:~ hchao$ Ping a.b.c.d
PING a.b.c.d (a.b.c.d): Data bytes
Bytes from a.b.c.d: icmp_seq=0 ttl=55 time=6.690 ms
Bytes from a.b.c.d: icmp_seq=1 ttl=55 time=5.536 ms
Bytes from a.b.c.d: icmp_seq=2 ttl=55 time=23.421 ms
Bytes from a.b.c.d: icmp_seq=3 ttl=55 time=8.740 ms
^c
--- a.b.c.d ping Statistics---
4 packets transmitted, 4 packets received, 0.0% packet loss
Round-trip Min/avg/max/stddev = 5.536/11.097/23.421/7.207 ms
huangchao-macbookpro:~ hchao$
Modify Configuration
[Email protected] etc]# vi/etc/sysctl.conf
[Email protected] etc]#
# System default Settings Live in/usr/lib/sysctl.d/00-system.conf.
# to override those settings, enter new settings here, or in an/etc/sysctl.d/<name>.conf file
# Disable Ping
Net.ipv4.icmp_echo_ignore_all=1
# For more information, see sysctl.conf (5) and SYSCTL.D (5).
Effect
[Email protected] etc]# sysctl-p
Net.ipv4.icmp_echo_ignore_all = 1
[Email protected] etc]#
Test
huangchao-macbookpro:~ hchao$ Ping a.b.c.d
PING a.b.c.d (a.b.c.d): Data bytes
Request Timeout for icmp_seq 0
Request Timeout for icmp_seq 1
Request Timeout for icmp_seq 2
Request Timeout for icmp_seq 3
Request Timeout for icmp_seq 4
Request Timeout for icmp_seq 5
Request Timeout for icmp_seq 6
Request Timeout for icmp_seq 7
Request Timeout for icmp_seq 8
^c
--- a.b.c.d ping Statistics---
Packets transmitted, 0 packets received, 100.0% packet loss
huangchao-macbookpro:~ hchao$
This article is from the "Huang Chao It Notes" blog, so be sure to keep this source http://huangchao.blog.51cto.com/10446378/1680794
"CentOS" Ping sysctl.conf