我们来看看能ping的状态是怎样的:
[xinshoujianzhan@nginx ~]# ping 192.168.3.117 PING 192.168.3.117 (192.168.3.117) 56(84) bytes of data. 64 bytes from 192.168.3.117: icmp_seq=1 ttl=64 time=0.477 ms 64 bytes from 192.168.3.117: icmp_seq=2 ttl=64 time=0.139 ms 64 bytes from 192.168.3.117: icmp_seq=3 ttl=64 time=0.142 ms 64 bytes from 192.168.3.117: icmp_seq=4 ttl=64 time=0.111 ms 64 bytes from 192.168.3.117: icmp_seq=5 ttl=64 time=0.129 ms 64 bytes from 192.168.3.117: icmp_seq=6 ttl=64 time=0.109 ms ^C --- 192.168.3.117 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 4999ms rtt min/avg/max/mdev = 0.101/0.181/0.477/0.133 ms
宝塔面板设置方法(推荐)
非常简单,只需勾选如下的选项就好了。如图:
使用root权限SSH修改配置文件
禁用ping
[root@ddfer ~]# vim /etc/sysctl.conf net.ipv4.icmp_echo_ignore_all=1
修改后生效
[root@ddfer ~]# sysctl -p net.ipv4.icmp_echo_ignore_all = 1
1代表禁止,0代表允许 修改完成后保存退出
好了,两种方法介绍完了,我们看看测试一下:
[root@nginx ~]# ping 192.168.3.117 PING 192.168.3.117 (192.168.3.117) 56(84) bytes of data.
完美~,更多建站教程请关注【新手建站网】
让建站更简单!