一個結合Ping、Traceroute (tracert)的工具:pathping
2011-02-09 09:23
369 查看
平時我們會用到Ping來檢測鏈路是否連通、或者看看對方主機是否Down掉,用traceroute (tracert)來查看鏈路的路由路徑。有時候我們會遇到這種情況:想看看經過路徑的路由器列表,同時又想Ping中間的每一個路由器。有些人會想到,那就手工一個一個ping,或者有人會想找甚麼網絡輔助工具來幫忙。
其實,用一個叫做pathping的命令就可以做到了。
Pathping同時具備了Ping和tracert的功能,它會先像Traceroute那樣取得路徑中轉發路由器的列表,然後再統計從每個路由器返回的結果。
Pathping命令:
Usage: pathping [-g host-list] [-h maximum_hops] [-i address] [-n]
[-p period] [-q num_queries] [-w timeout]
[-4] [-6] target_nameOptions:
-g host-list Loose source route along host-list.
-h maximum_hops Maximum number of hops to search for target.
-i address Use the specified source address.
-n Do not resolve addresses to hostnames.
-p period Wait period milliseconds between pings.
-q num_queries Number of queries per hop.
-w timeout Wait timeout milliseconds for each reply.
-4 Force using IPv4.
-6 Force using IPv6.
其中,使用 -n 參數相當於在tracert命令使用 -d 參數一樣,不把IP地址反向解析爲主機名。對於一些雙棧主機而言,參數 -4 和 -6 都比較有用。個人習慣使用 / 代替 – 。
以我的電腦爲例,用pathping測試google.com。我使用了IPv6,並且在Hosts文件中強行指定Google用IPv6連接,因此pathping默認會用IPv6測試Google.com。
C:\>pathping /n www.google.comTracing route to www.google.com [2404:6800:8005::68]
over a maximum of 30 hops:
0 2001:0:53aa:64c:188e:6ff:8ebe:a1ee
1 2001:470:0:163::2
2 2001:470:0:163::1
3 2001:7fa:0:1::ca28:a10a
4 2001:4860::1:0:1063
5 2001:4860::2:0:119b
6 2001:4860:0:1::e3
7 2404:6800:8005::68Computing statistics for 175 seconds...
Source to Here This Node/Link
Hop RTT Lost/Sent = Pct Lost/Sent = Pct Address
0 2001:0:53aa:64c:188e:6ff:8ebe:a1ee
0/ 100 = 0% |
1 335ms 0/ 100 = 0% 0/ 100 = 0% 2001:470:0:163::2
0/ 100 = 0% |
2 336ms 0/ 100 = 0% 0/ 100 = 0% 2001:470:0:163::1
0/ 100 = 0% |
3 --- 100/ 100 =100% 100/ 100 =100% 2001:7fa:0:1::ca28:a10a
0/ 100 = 0% |
4 338ms 1/ 100 = 1% 1/ 100 = 1% 2001:4860::1:0:1063
0/ 100 = 0% |
5 335ms 1/ 100 = 1% 1/ 100 = 1% 2001:4860::2:0:119b
0/ 100 = 0% |
6 339ms 1/ 100 = 1% 1/ 100 = 1% 2001:4860:0:1::e3
0/ 100 = 0% |
7 334ms 0/ 100 = 0% 0/ 100 = 0% 2404:6800:8005::68
Tracoe complete.
一目瞭然,可以看到經過了哪些地方,在哪些地方丟包、丟了多少。
其中,0號是本機地址。對於大多數電腦而言,主要用的還是IPv4,即使同時存在IPv6,Windows默認依然會用IPv4去連接,除非被強行指定使用IPv6鏈路(比如訪問某些網站時DNS祗給出IPv6地址,或者Hosts綁定),pathping默認使用IPv4去測試。
其實,用一個叫做pathping的命令就可以做到了。
Pathping同時具備了Ping和tracert的功能,它會先像Traceroute那樣取得路徑中轉發路由器的列表,然後再統計從每個路由器返回的結果。
Pathping命令:
Usage: pathping [-g host-list] [-h maximum_hops] [-i address] [-n]
[-p period] [-q num_queries] [-w timeout]
[-4] [-6] target_nameOptions:
-g host-list Loose source route along host-list.
-h maximum_hops Maximum number of hops to search for target.
-i address Use the specified source address.
-n Do not resolve addresses to hostnames.
-p period Wait period milliseconds between pings.
-q num_queries Number of queries per hop.
-w timeout Wait timeout milliseconds for each reply.
-4 Force using IPv4.
-6 Force using IPv6.
其中,使用 -n 參數相當於在tracert命令使用 -d 參數一樣,不把IP地址反向解析爲主機名。對於一些雙棧主機而言,參數 -4 和 -6 都比較有用。個人習慣使用 / 代替 – 。
以我的電腦爲例,用pathping測試google.com。我使用了IPv6,並且在Hosts文件中強行指定Google用IPv6連接,因此pathping默認會用IPv6測試Google.com。
C:\>pathping /n www.google.comTracing route to www.google.com [2404:6800:8005::68]
over a maximum of 30 hops:
0 2001:0:53aa:64c:188e:6ff:8ebe:a1ee
1 2001:470:0:163::2
2 2001:470:0:163::1
3 2001:7fa:0:1::ca28:a10a
4 2001:4860::1:0:1063
5 2001:4860::2:0:119b
6 2001:4860:0:1::e3
7 2404:6800:8005::68Computing statistics for 175 seconds...
Source to Here This Node/Link
Hop RTT Lost/Sent = Pct Lost/Sent = Pct Address
0 2001:0:53aa:64c:188e:6ff:8ebe:a1ee
0/ 100 = 0% |
1 335ms 0/ 100 = 0% 0/ 100 = 0% 2001:470:0:163::2
0/ 100 = 0% |
2 336ms 0/ 100 = 0% 0/ 100 = 0% 2001:470:0:163::1
0/ 100 = 0% |
3 --- 100/ 100 =100% 100/ 100 =100% 2001:7fa:0:1::ca28:a10a
0/ 100 = 0% |
4 338ms 1/ 100 = 1% 1/ 100 = 1% 2001:4860::1:0:1063
0/ 100 = 0% |
5 335ms 1/ 100 = 1% 1/ 100 = 1% 2001:4860::2:0:119b
0/ 100 = 0% |
6 339ms 1/ 100 = 1% 1/ 100 = 1% 2001:4860:0:1::e3
0/ 100 = 0% |
7 334ms 0/ 100 = 0% 0/ 100 = 0% 2404:6800:8005::68
Tracoe complete.
一目瞭然,可以看到經過了哪些地方,在哪些地方丟包、丟了多少。
其中,0號是本機地址。對於大多數電腦而言,主要用的還是IPv4,即使同時存在IPv6,Windows默認依然會用IPv4去連接,除非被強行指定使用IPv6鏈路(比如訪問某些網站時DNS祗給出IPv6地址,或者Hosts綁定),pathping默認使用IPv4去測試。
相关文章推荐
- mtr,traceroute,pathping,tracert,ping
- [Linux][RK3399] 以太网调试 — 利用 ping 和 pathping 工具
- ping, tracert和traceroute命令详解【转】
- PING能通,traceroute不通以及与tracert的区别
- ping, tracert和traceroute命令详解【转】
- 【分享】一个集成tracert和ping的网络监测工具
- Tracert(traceroute)&Ping 工作原理分析
- ping, tracert和traceroute命令详解【转】
- ping, tracert和traceroute命令详解
- ping, tracert, traceroute, netstat命令详解
- 网络测试常用的命令-比较ping,tracert和pathping等命令之间的关系
- 你知道ping和traceroute,但你知道mtr网络诊断工具么?
- tracert(traceroute)与ping
- linux 网络管理 监测等相关的工具 ping 、traceroute、ss、netstat
- Linux下ping命令、traceroute命令、tracert命令的使用
- ping, tracert和traceroute命令详解
- 计算机网络测试方式,ping,tracert,traceroute,icmp,telnet
- 路由器和防火墙对Ping/Tracert工具的影响
- netstat, traceroute(tracert), ping 必备命令
- 网络测试常用的命令-比较ping,tracert和pathping等命令之间的关系