展开全部
要关闭e69da5e6ba9062616964757a686964616f31333365643662防火墙设置,避免防火墙禁止ping或者在内核参数中禁止ping,这样就不能通过ping确定该主机是否还处于开启状态了。
指定次数的ping的命令:
1、[root@LiWenTong ~]# ping -c 4 www.baidu.com
PING www.a.shifen.com (115.239.210.27) 56(84) bytesof data.
64 bytes from 115.239.210.27: icmp_seq=1 ttl=56 time=17.5 ms---》可以看到从开始到接到返回信息的时间。
64 bytes from 115.239.210.27: icmp_seq=2 ttl=56time=18.6 ms
64 bytes from 115.239.210.27: icmp_seq=3 ttl=56time=17.9 ms
64 bytes from 115.239.210.27: icmp_seq=4 ttl=56time=17.8 ms
2、[root@LiWenTong ~]# ping -i 3 -c 5 -s 1024 www.baidu.com
PING www.a.shifen.com (115.239.210.26) 1024(1052)bytes of data.—》以间隔时间为3秒,大小为1024的ping包去ping百度。
1032 bytes from 115.239.210.26: icmp_seq=1 ttl=56time=18.8 ms
1032 bytes from 115.239.210.26: icmp_seq=2 ttl=56time=19.6 ms
1032 bytes from 115.239.210.26: icmp_seq=3 ttl=56time=18.2 ms
1032 bytes from 115.239.210.26: icmp_seq=4 ttl=56time=17.5 ms
1032 bytes from 115.239.210.26: icmp_seq=5 ttl=56time=19.1 ms
3、[root@LiWenTong ~]# ping 192.168.41.101
PING 192.168.41.101 (192.168.41.101) 56(84) bytesof data. ---》说明目标网络不可达,就是没有。
From 192.168.41.48 icmp_seq=2 Destination HostUnreachable
From 192.168.41.48 icmp_seq=3 Destination HostUnreachable
From 192.168.41.48 icmp_seq=4 Destination HostUnreachable
From 192.168.41.48 icmp_seq=5 Destination HostUnreachable
From 192.168.41.48 icmp_seq=6 Destination HostUnreachable
From 192.168.41.48 icmp_seq=7 Destination HostUnreachable