Chinaunix首页 | 论坛 | 博客
  • 博客访问: 208512
  • 博文数量: 53
  • 博客积分: 2059
  • 博客等级: 大尉
  • 技术积分: 577
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-30 03:03
文章分类
文章存档

2012年(4)

2011年(19)

2010年(30)

分类: LINUX

2010-08-20 11:18:52

一般在windows 来判断网络连通性用ping 和tracert,ping的话可以来判断丢包率,tracert可以用来跟踪路由,在Linux中有一个更好的网络连通性判断工具,它可以结合ping nslookup tracert 来判断网络的相关特性,这个命令就是mtr
acid]# mtr -h
usage: mtr [-hvrctglspni46] [--help] [--version] [--report]
  [--report-cycles=COUNT] [--curses] [--gtk]
  [--raw] [--split] [--no-dns] [--address interface]
  [--psize=bytes/-s bytes]
  [--interval=SECONDS] HOSTNAME [PACKETSIZE]
根据以上参数:mtr -h 提供帮助命令
mtr -v 显示mtr的版本信息
mtr -r 已报告模式显示 例This option puts mtr into report mode.  When in this mode, mtr will run for the number of cycles specified by the -c option, and then print statistics and exit.
[root@test6 ~]# mtr -r   218.213.83.193
test6.test.com                    Snt: 10    Loss%  Last   Avg  Best  Wrst StDev
172.16.3.2                                    0.0%   0.8   1.8   0.8   9.2   2.6
115.238.91.225                                0.0%   1.7   2.3   1.2   5.6   1.5
61.130.126.125                                0.0%   4.2   1.9   1.1   5.4   1.5
220.191.128.113                               0.0%   3.4   1.8   0.9   5.0   1.3
202.97.55.5                                   0.0%   7.1   4.3   3.4   7.1   1.1
202.97.33.74                                  0.0%   5.2   4.4   3.7   6.6   0.9
202.97.33.2                                  10.0%   5.6   6.9   5.6  10.2   1.5
202.97.33.5                                   0.0%   4.0   4.7   3.7   7.1   1.2
202.97.61.38                                  0.0%  33.5  33.5  31.8  36.8   1.5
202.97.62.58                                  0.0%  80.7  35.8  28.7  80.7  16.2
218.213.83.193                                0.0%  29.9  36.2  29.0  95.0  20.7
可发现我们测试一个IP地址以报告的形式呈现。
报告说明:
在报告的第一列显示的是IP地址和本机域名,这点和tracert很像
第二列 snt:10 设置每秒发送数据包的数量,默认值是10 可以通过参数 -c来指定。
[root@test6 ~]# mtr -r  -c 20  218.213.83.193
test6.test.com                    Snt: 20    Loss%  Last   Avg  Best  Wrst StDev
172.16.3.2                                    0.0%   0.8   2.1   0.7  10.4   2.3
115.238.91.225                                0.0%   1.1   1.6   1.1   2.9   0.5
61.130.126.125                                0.0%   1.8   1.4   0.9   2.3   0.3
220.191.128.113                               0.0%   1.0   3.4   1.0  22.8   6.6
202.97.55.5                                   0.0%   3.8   3.6   3.3   4.1   0.2
202.97.33.74                                  0.0%   3.9   3.8   3.4   4.7   0.3
202.97.33.2                                  10.0%   6.6   6.8   6.1   7.5   0.5
202.97.33.5                                   0.0%   3.7   4.0   3.7   5.0   0.4
202.97.61.38                                 15.0%  32.4  32.5  31.3  34.9   0.9
202.97.62.58                                  0.0%  28.6  29.1  28.5  33.1   1.0
218.213.83.193                                0.0%  30.0  29.6  29.1  30.4   0.4
其中-c 的说明是:
--report-cycles COUNT
Use this option to set the number of pings sent to determine both the machines on the network and the reliability of those  machines.Each cycle lasts one second
第三列是显示的每个对应IP的丢包率
第四列显示的最近一次的返回时延
第五列是平均值 这个应该是发送ping包的平均时延
第六列是最好或者说时延最短的
第七列是 最差或者说时延最常的
第八列是 标准偏差 这个说实话,我也不知道他们是怎么来计算的。(谁知道发邮件告诉我一下)
接下来接着说相关参数:
mtr -s 用来指定ping数据包的大小
mtr -n no-dns不对IP地址做域名解析
mtr -a 来设置发送数据包的IP地址 这个对一个主机由多个IP地址是有用的
mtr -i 使用这个参数来设置ICMP返回之间的要求默认是1秒
mtr -4 IPv4
mtr -6 IPv6
 
阅读(1364) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~