ping命令

ping侦测两主机是否连通
选项:
-c 数值:ping的次数
-n:输出数据不进行ip与主机名反查
-s 数值:指定ICMP数据包大小,默认64bytes
-t 数值:TTL的数值,外网默认255,局域网默认64
-W 数值:等待响应对方主机的秒数

[root@www ~]# ping baidu.com
PING baidu.com (111.13.101.208) 56(84) bytes of data.
64 bytes from 111.13.101.208: icmp_seq=1 ttl=128 time=4.41 ms
64 bytes from 111.13.101.208: icmp_seq=2 ttl=128 time=4.61 ms
[root@www ~]# ping 192.168.146.130
PING 192.168.146.130 (192.168.146.130) 56(84) bytes of data.
64 bytes from 192.168.146.130: icmp_seq=1 ttl=64 time=3.32 ms
64 bytes from 192.168.146.130: icmp_seq=2 ttl=64 time=0.195 ms

[root@www ~]# ping baidu.com -c 2
PING baidu.com (111.13.101.208) 56(84) bytes of data.
64 bytes from 111.13.101.208: icmp_seq=1 ttl=128 time=4.24 ms
64 bytes from 111.13.101.208: icmp_seq=2 ttl=128 time=4.35 ms

--- baidu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 2025ms
rtt min/avg/max/mdev = 4.246/4.298/4.350/0.052 ms

[root@www ~]# ping baidu.com -s 128
PING baidu.com (220.181.57.216) 128(156) bytes of data.
136 bytes from 220.181.57.216: icmp_seq=1 ttl=128 time=3.91 ms
136 bytes from 220.181.57.216: icmp_seq=2 ttl=128 time=3.42 ms
136 bytes from 220.181.57.216: icmp_seq=3 ttl=128 time=3.31 ms
136 bytes from 220.181.57.216: icmp_seq=4 ttl=128 time=3.53 ms

--- baidu.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 4949ms
rtt min/avg/max/mdev = 3.310/3.545/3.913/0.230 ms

转载于:https://blog.51cto.com/12107790/2104970

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值