5

使用mtr查看网络连通性

 3 years ago
source link: https://www.bboy.app/2021/08/02/%E4%BD%BF%E7%94%A8mtr%E6%9F%A5%E7%9C%8B%E7%BD%91%E7%BB%9C%E8%BF%9E%E9%80%9A%E6%80%A7/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

使用mtr查看网络连通性

发表于

2021-08-02 分类于 linux

20210802100754.png

个人不是很喜欢使用traceroute,最主要原因是不够直观,今天介绍下mtr

使用很简单直接

mtr www.baidu.com

而且速度很快结果几乎是秒出

而且可以很直观的看到路过的ip地址,平均延迟还有丢包率

当然你也可以加上参数

mtr -r www.baidu.com

[root@localhost ~]# mtr -r www.baidu.com
Start: Mon Aug 2 10:00:11 2021
HOST: localhost.localdomain Loss% Snt Last Avg Best Wrst StDev
1.|-- gateway 0.0% 10 0.4 0.4 0.3 0.6 0.0
2.|-- 192.168.1.1 0.0% 10 0.8 1.0 0.7 3.3 0.7
3.|-- 10.120.0.1 0.0% 10 3.3 3.7 2.2 8.4 1.6
4.|-- 183.247.232.61 0.0% 10 5.1 3.6 3.2 5.1 0.5
5.|-- 221.183.47.189 0.0% 10 7.0 7.8 6.6 13.1 1.9
6.|-- 221.183.42.129 0.0% 10 14.8 15.5 14.0 19.4 1.4
7.|-- 221.183.59.54 0.0% 10 14.4 14.9 14.0 18.0 1.1
8.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0
9.|-- 182.61.216.72 0.0% 10 14.9 15.2 14.5 15.7 0.0
10.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0
11.|-- 36.152.44.96 0.0% 10 13.6 13.6 13.4 13.7 0.0

-r 是用来打印报告的,这样就不会一直保持运行状态,默认-r参数会向主机发送10个icmp包,所以需要一段时间才可以输出结果

mtr -c 1 -r www.baidu.com

-c 表示指定发的icmp包个数

mtr -n -c 1 -r www.baidu.com

-n 表示只输出ip,不去对hostname进行解析

欢迎关注我的博客www.bboy.app
Have Fun


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK