1. 程式人生 > >1-3、ping 和tracert 命令的使用

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

ado byte 6.4 包含 repl 路由器 windows second 0ms

技術分享圖片

技術分享圖片

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 命令的使用