码迷,mamicode.com
首页 > 其他好文 > 详细

1-3、ping 和tracert 命令的使用

时间:2018-01-20 14:03:56      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:stat   shadow   cin   loss   linux   byte   .sh   技术   mil   

技术分享图片

技术分享图片

C:\>ping 192.168.0.1

Pinging 192.168.0.1 with 32 bytes of data:
Reply from 192.168.0.1: bytes=32 time=12ms TTL=64
Reply from 192.168.0.1: bytes=32 time=12ms TTL=64
Reply from 192.168.0.1: bytes=32 time=5ms TTL=64
Reply from 192.168.0.1: bytes=32 time=2ms TTL=64

Ping statistics for 192.168.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 12ms, Average = 7ms

C:\>

TTL有3个值,64 , 128 , 255
对应的OS linux , windows, router
其实这是不准确的,可以修改注册表的值来改变TTL的值

C:\>ping www.baidu.com

Pinging www.a.shifen.com [14.215.177.39] with 32 bytes of data:
Reply from 14.215.177.39: bytes=32 time=10ms TTL=54
Reply from 14.215.177.39: bytes=32 time=10ms TTL=54
Reply from 14.215.177.39: bytes=32 time=10ms TTL=54
Reply from 14.215.177.39: bytes=32 time=16ms TTL=54

Ping statistics for 14.215.177.39:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 10ms, Maximum = 16ms, Average = 11ms

C:\>

ping www.baidu.com 其TTL值是54 ,64-54=10 ,所以我的这个电脑访问百度经过了10个路由器

可以用tracert来验证其是不是经过10个路由器,从以下结果可以知道是经过10路由器,但是不包含最后一个路由器的。
C:\>tracert www.baidu.com

Tracing route to www.a.shifen.com [14.215.177.39]
over a maximum of 30 hops:

1 2 ms 1 ms 9 ms 192.168.0.1
2 7 ms 3 ms 1 ms 192.168.1.1
3 6 ms 9 ms 11 ms 100.64.0.1
4 7 ms 4 ms 7 ms 113.106.42.53
5 9 ms 5 ms 7 ms 17.107.38.59.broad.fs.gd.dynamic.163data.com.cn [59.38.107.17]
6 20 ms 4 ms 16 ms 202.105.158.73
7 13 ms 14 ms 26 ms 113.96.4.66
8 Request timed out.
9 10 ms 8 ms 20 ms 14.29.121.202
10
Request timed out.
11 23 ms 7 ms 8 ms 14.215.177.39

Trace complete.

1-3、ping 和tracert 命令的使用

标签:stat   shadow   cin   loss   linux   byte   .sh   技术   mil   

原文地址:http://blog.51cto.com/guanhaizhan/2063112

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!