主页

索引

模块索引

搜索页面

tracert命令

tracert <ip> or <domain>

// MacOS下用traceroute
traceroute -l <domain>

tracepath <domain>  //在ubuntu下可代替tracert的命令

$ mtr <domain>      //交互式命令, 每秒刷新一次, 可以使用交互命令 i 调整时间

假双线查询:

使用如下命令查看ip转向:
  $ tracert <ip>
  $ tracert <domain>
  or
  $ mtr <domain>
  or
  tracepath <domain>

进入服务器使用如下命令查看双线映射路由表:
  route -e
  or
  netstat -r

实战

家里连不上国外的服务器原因定位

本地测试我国内阿里云的情况(通✅):

$ traceroute 120.126.162.222
traceroute to 120.126.162.222 (120.126.162.222), 64 hops max, 52 byte packets
 1  xiaoqiang (192.168.31.1)  2.251 ms  1.885 ms  1.772 ms
 2  223.21.192.1 (223.21.192.1)  3.951 ms  3.893 ms  3.744 ms
 3  124.205.98.14 (124.205.98.14)  3.984 ms  4.463 ms  3.791 ms
 4  218.241.246.149 (218.241.246.149)  4.194 ms  3.853 ms  3.586 ms
 5  14.197.177.5 (14.197.177.5)  4.205 ms
    14.197.177.13 (14.197.177.13)  4.224 ms
    14.197.243.121 (14.197.243.121)  4.033 ms
 6  14.197.199.50 (14.197.199.50)  37.533 ms
    14.197.246.221 (14.197.246.221)  36.109 ms
    14.197.254.86 (14.197.254.86)  38.080 ms
 7  14.197.246.221 (14.197.246.221)  36.219 ms
    14.197.216.2 (14.197.216.2)  32.212 ms
    14.197.217.6 (14.197.217.6)  36.897 ms
 8  42.120.247.89 (42.120.247.89)  39.722 ms
    14.197.201.2 (14.197.201.2)  35.971 ms
    14.197.254.86 (14.197.254.86)  37.570 ms
 9  116.251.115.225 (116.251.115.225)  36.854 ms
    14.197.201.6 (14.197.201.6)  36.749 ms
    117.49.36.221 (117.49.36.221)  41.777 ms
10  11.182.220.9 (11.182.220.9)  43.553 ms
    117.49.36.245 (117.49.36.245)  37.073 ms
    42.120.247.73 (42.120.247.73)  36.448 ms
11  * 116.251.115.229 (116.251.115.229)  40.623 ms
    45.112.223.45 (45.112.223.45)  37.030 ms
12  116.251.115.225 (116.251.115.225)  36.657 ms
    11.182.220.41 (11.182.220.41)  42.385 ms
    116.251.115.233 (116.251.115.233)  39.300 ms
13  120.126.162.222 (120.126.162.222)  36.397 ms  35.999 ms  37.012 ms

在国内阿里云测试国外服务器(通✅):

$ traceroute 3.128.104.161
traceroute to 3.128.104.161 (3.128.104.161), 30 hops max, 60 byte packets
 1  * * *
 2  11.220.129.93 (11.220.129.93)  10.197 ms 11.220.128.5 (11.220.128.5)  10.898 ms 11.220.128.13 (11.220.128.13)  11.062 ms
 3  11.220.128.137 (11.220.128.137)  5.168 ms * *
 4  11.182.220.10 (11.182.220.10)  0.562 ms 11.200.0.230 (11.200.0.230)  0.553 ms 11.182.220.50 (11.182.220.50)  0.571 ms
 5  42.120.244.233 (42.120.244.233)  4.223 ms 117.49.36.222 (117.49.36.222)  1.600 ms 117.49.36.210 (117.49.36.210)  1.538 ms
 6  116.251.105.221 (116.251.105.221)  1.129 ms 45.112.223.38 (45.112.223.38)  1.274 ms 45.112.223.18 (45.112.223.18)  1.204 ms
 7  122.224.214.77 (122.224.214.77)  1.091 ms 115.236.101.218 (115.236.101.218)  0.987 ms 115.238.21.122 (115.238.21.122)  1.127 ms
 8  220.191.200.53 (220.191.200.53)  4.927 ms 220.191.200.117 (220.191.200.117)  4.940 ms 220.191.200.121 (220.191.200.121)  4.897 ms
 9  202.97.26.17 (202.97.26.17)  9.960 ms  9.568 ms  9.062 ms
10  * 202.97.62.158 (202.97.62.158)  5.469 ms *
11  202.97.12.194 (202.97.12.194)  5.156 ms 202.97.12.182 (202.97.12.182)  5.302 ms  5.381 ms
12  202.97.70.130 (202.97.70.130)  179.012 ms  181.234 ms *
13  202.97.90.118 (202.97.90.118)  170.146 ms  170.084 ms 202.97.92.37 (202.97.92.37)  161.613 ms
14  * 218.30.53.2 (218.30.53.2)  262.430 ms *
15  * * *
16  * * *
17  52.93.131.106 (52.93.131.106)  298.142 ms * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  52.95.3.36 (52.95.3.36)  329.484 ms * 52.95.3.38 (52.95.3.38)  313.083 ms
25  52.95.2.163 (52.95.2.163)  298.731 ms 52.95.2.139 (52.95.2.139)  345.959 ms 52.95.2.193 (52.95.2.193)  330.739 ms
26  52.95.2.246 (52.95.2.246)  300.527 ms 52.95.2.138 (52.95.2.138)  312.405 ms 52.95.3.20 (52.95.3.20)  307.654 ms
27  15.230.39.191 (15.230.39.191)  328.865 ms 15.230.39.187 (15.230.39.187)  340.526 ms 52.95.2.115 (52.95.2.115)  323.751 ms
28  15.230.39.170 (15.230.39.170)  304.010 ms * *
29  * * *
30  * * *

从本地测试国外服务器(不通🚫):

$ traceroute 3.128.104.161
traceroute to 3.128.104.161 (3.128.104.161), 64 hops max, 52 byte packets
 1  xiaoqiang (192.168.31.1)  1.937 ms  2.163 ms  2.615 ms
 2  223.21.192.1 (223.21.192.1)  2.930 ms  3.478 ms  3.662 ms
 3  124.205.98.14 (124.205.98.14)  3.798 ms  3.205 ms  2.819 ms
 4  124.205.98.161 (124.205.98.161)  3.414 ms  10.504 ms  3.888 ms
 5  124.205.98.89 (124.205.98.89)  4.023 ms  10.100 ms  3.969 ms
 6  202.99.1.233 (202.99.1.233)  4.859 ms
    202.99.1.141 (202.99.1.141)  6.473 ms
    202.99.1.125 (202.99.1.125)  4.382 ms
 7  61.51.37.185 (61.51.37.185)  8.037 ms
    61.51.37.193 (61.51.37.193)  4.455 ms *
 8  202.96.13.113 (202.96.13.113)  4.838 ms
    202.96.13.241 (202.96.13.241)  4.851 ms
    202.96.13.113 (202.96.13.113)  4.587 ms
 9  202.96.12.93 (202.96.12.93)  8.427 ms  6.785 ms  8.234 ms
10  219.158.16.90 (219.158.16.90)  27.816 ms
    219.158.6.170 (219.158.6.170)  28.091 ms  26.872 ms
11  219.158.19.70 (219.158.19.70)  73.040 ms
    219.158.19.82 (219.158.19.82)  85.373 ms  78.447 ms
12  219.158.113.137 (219.158.113.137)  40.472 ms
    219.158.19.77 (219.158.19.77)  42.607 ms
    219.158.113.137 (219.158.113.137)  42.252 ms
13  219.158.116.238 (219.158.116.238)  236.541 ms  316.651 ms  250.744 ms
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *

解决方案:

@todo

主页

索引

模块索引

搜索页面