Linux系统服务器基本信息、性能、带宽的测试,有很多脚本可以使用,陌涛在小站也收集整理了部分,个人比较常用的是bench.sh、Superspeed.sh。
今天在这里为大家分享一个Linux系统服务器中国电信/联通/移动回程路由追踪一键测试脚本,陌涛根据大佬们制作的脚本修改了测试节点,可以一键测试服务器到北京电信、天津联通、北京移动、杭州电信、宁波联通、杭州移动、贵阳电信、贵阳联通、贵阳移动、广州电信、深圳联通、广州移动、上海电信、上海联通、上海移动、成都教育网16个节点的回程路由情况,涵盖了华北、华东、西南地区的电信、联通、移动节点,相对来说测试节点分布比较合理。当然有兴趣的自己也可以修改节点,文章后面会介绍如何修改。
一、脚本测试命令
1、如果需要测试服务器国内节点的回程路由情况,使用SSH工具连接服务器后,输入下面命令即可。
yum -y install wget wget -qO- git.io/fphX1 | bash #或 yum -y install wget wget -qO- https://raw.githubusercontent.com/wn789/VPS-/master/autoBestTrace.sh | bash
2、测试结果展示。
北京电信 traceroute to 220.181.22.1 (220.181.22.1), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 et-0-0-61.cr3-lax2.ip4.gtt.net (76.74.41.89) 0.59 ms http: json http: json 6 218.30.54.72 2.98 ms http: json http: json 7 202.97.92.46 1.10 ms http: json http: json 8 202.97.41.197 148.59 ms http: json http: json 9 202.97.12.153 152.24 ms http: json http: json 10 202.97.48.249 163.29 ms http: json http: json 11 180.149.128.50 153.57 ms http: json http: json 12 218.30.28.174 156.01 ms http: json http: json 13 220.181.16.114 272.11 ms http: json http: json 14 * 15 * 16 * 17 * 18 * 19 * 20 * 21 * 22 * 23 * 24 * 25 * 26 * 27 * 28 * 29 * 30 * ---------------------------------------------------------------------- 辽宁联通 traceroute to 220.201.8.6 (220.201.8.6), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 las-b4-link.ip.twelve99.net (62.115.149.36) 1.10 ms http: json http: json 6 las-b2-link.ip.twelve99.net (62.115.125.163) 0.44 ms http: json http: json 7 las-b2-link.ip.twelve99.net (62.115.125.163) 22.18 ms http: json http: json 8 chinaunicom-ic155914-las-bb1.ip.twelve99-cust.net (213.248.82.206) 19.48 ms http: json http: json 9 219.158.96.25 152.59 ms http: json http: json 10 219.158.3.145 157.38 ms http: json http: json 11 * 12 219.158.105.90 157.15 ms http: json http: json 13 218.61.254.226 170.59 ms http: json http: json 14 218.61.254.202 174.48 ms http: json http: json 15 * 16 218.61.252.149 160.50 ms http: json http: json 17 * 18 218.61.252.149 165.98 ms http: json http: json 19 * 20 218.61.252.149 170.43 ms http: json http: json 21 * 22 218.61.252.149 154.98 ms http: json http: json 23 * 24 218.61.252.149 170.57 ms http: json http: json 25 218.61.252.150 158.09 ms http: json http: json 26 218.61.252.149 166.23 ms http: json http: json 27 * 28 218.61.252.149 159.04 ms http: json http: json 29 218.61.252.150 166.59 ms http: json http: json 30 218.61.252.149 172.11 ms http: json http: json ---------------------------------------------------------------------- 北京移动 traceroute to 221.130.33.1 (221.130.33.1), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 china-mobile.as58453.any2ix.coresite.com (206.72.210.219) 8.13 ms http: json http: json 6 223.120.6.17 8.36 ms http: json http: json 7 223.120.13.2 187.84 ms http: json http: json 8 221.183.55.102 192.25 ms http: json http: json 9 221.183.46.250 204.93 ms http: json http: json 10 221.176.21.229 191.82 ms http: json http: json 11 111.24.2.101 189.09 ms http: json http: json 12 111.24.2.134 193.28 ms http: json http: json 13 211.136.66.129 190.20 ms http: json http: json 14 221.179.159.238 190.89 ms http: json http: json 15 221.130.33.1 189.50 ms http: json http: json ---------------------------------------------------------------------- 杭州电信 traceroute to 60.176.0.1 (60.176.0.1), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 et-0-0-61.cr3-lax2.ip4.gtt.net (76.74.41.89) 0.30 ms http: json http: json 6 218.30.54.72 1.08 ms http: json http: json 7 202.97.83.241 2.72 ms http: json http: json 8 202.97.70.129 147.52 ms http: json http: json 9 202.97.74.2 146.02 ms http: json http: json 10 202.97.24.189 143.74 ms http: json http: json 11 202.97.101.194 158.48 ms http: json http: json 12 * 13 60.176.0.1 140.86 ms http: json http: json ---------------------------------------------------------------------- 宁波联通 traceroute to 60.12.17.1 (60.12.17.1), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 las-b4-link.ip.twelve99.net (62.115.149.36) 0.39 ms http: json http: json 6 las-b2-link.ip.twelve99.net (62.115.125.163) 2.07 ms http: json http: json 7 las-b2-link.ip.twelve99.net (62.115.125.163) 0.82 ms http: json http: json 8 chinaunicom-ic324374-las-b24.ip.twelve99-cust.net (62.115.154.91) 7.59 ms http: json http: json 9 219.158.16.93 166.79 ms http: json http: json 10 219.158.3.137 167.41 ms http: json http: json 11 * 12 219.158.107.154 192.31 ms http: json http: json 13 * 14 221.12.33.37 175.71 ms http: json http: json 15 * 16 60.12.17.1 184.30 ms http: json http: json ---------------------------------------------------------------------- 杭州移动 traceroute to 211.140.0.2 (211.140.0.2), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 china-mobile.as58453.any2ix.coresite.com (206.72.210.219) 8.14 ms http: json http: json 6 223.120.6.17 8.35 ms http: json http: json 7 223.120.13.46 180.93 ms http: json http: json 8 221.183.55.26 167.98 ms http: json http: json 9 221.176.22.205 214.17 ms http: json http: json 10 221.183.23.37 163.77 ms http: json http: json 11 221.176.22.122 205.07 ms http: json http: json 12 * 13 * 14 * 15 * 16 * 17 * 18 * 19 * 20 * 21 * 22 * 23 * 24 * 25 * 26 * 27 * 28 * 29 * 30 * ---------------------------------------------------------------------- 贵阳电信 traceroute to 58.42.224.1 (58.42.224.1), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 * 6 et-0-0-61.cr3-lax2.ip4.gtt.net (76.74.41.89) 0.77 ms http: json http: json 7 218.30.54.72 2.32 ms http: json http: json 8 202.97.50.21 0.61 ms http: json http: json 9 202.97.51.97 154.87 ms http: json http: json 10 202.97.91.146 149.32 ms http: json http: json 11 202.97.89.157 171.72 ms http: json http: json 12 * 13 61.189.177.150 172.51 ms http: json http: json 14 58.42.224.1 173.01 ms http: json http: json ---------------------------------------------------------------------- 贵阳联通 traceroute to 58.16.28.1 (58.16.28.1), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 et-0-0-61.cr3-lax2.ip4.gtt.net (76.74.41.89) 0.87 ms http: json http: json 6 ae2.cr5-sjc1.ip4.gtt.net (89.149.180.26) 7.86 ms http: json http: json 7 as4837.cr5-sjc1.ip4.gtt.net (173.205.56.178) 149.52 ms http: json http: json 8 219.158.97.177 170.33 ms http: json http: json 9 219.158.113.126 164.26 ms http: json http: json 10 219.158.113.109 165.76 ms http: json http: json 11 219.158.106.26 190.98 ms http: json http: json 12 * 13 58.16.28.1 190.84 ms http: json http: json ---------------------------------------------------------------------- 贵阳移动 traceroute to 211.139.0.10 (211.139.0.10), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 china-mobile.as58453.any2ix.coresite.com (206.72.210.219) 8.15 ms http: json http: json 6 223.120.6.17 8.32 ms http: json http: json 7 223.120.12.10 177.08 ms http: json http: json 8 221.183.55.78 163.63 ms http: json http: json 9 221.176.20.5 162.94 ms http: json http: json 10 221.183.68.138 172.68 ms http: json http: json 11 111.24.5.193 164.97 ms http: json http: json 12 111.24.5.94 186.57 ms http: json http: json 13 111.24.12.58 176.47 ms http: json http: json 14 211.139.13.142 187.71 ms http: json http: json 15 211.139.0.10 197.37 ms http: json http: json ---------------------------------------------------------------------- 广州电信 traceroute to 14.215.116.1 (14.215.116.1), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 * 6 et-0-0-61.cr3-lax2.ip4.gtt.net (76.74.41.89) 7.11 ms http: json http: json 7 218.30.54.72 2.46 ms http: json http: json 8 202.97.93.165 1.28 ms http: json http: json 9 202.97.83.221 155.59 ms http: json http: json 10 202.97.91.146 156.00 ms http: json http: json 11 202.97.90.161 165.90 ms http: json http: json 12 113.96.5.62 168.61 ms http: json http: json 13 113.96.4.226 166.69 ms http: json http: json 14 * 15 183.56.129.2 176.71 ms http: json http: json 16 14.215.116.1 165.74 ms http: json http: json ---------------------------------------------------------------------- 深圳联通 traceroute to 58.250.0.1 (58.250.0.1), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 las-b4-link.ip.twelve99.net (62.115.149.36) 0.39 ms http: json http: json 6 las-b2-link.ip.twelve99.net (62.115.125.163) 2.46 ms http: json http: json 7 las-b2-link.ip.twelve99.net (62.115.125.163) 3.94 ms http: json http: json 8 chinaunicom-ic-151188-las-bb1.ip.twelve99.net (213.248.94.126) 16.87 ms http: json http: json 9 219.158.96.25 164.97 ms http: json http: json 10 219.158.16.69 143.93 ms http: json http: json 11 219.158.5.149 154.81 ms http: json http: json 12 219.158.7.22 195.90 ms http: json http: json 13 157.148.0.50 181.79 ms http: json http: json 14 58.250.0.1 179.43 ms http: json http: json ---------------------------------------------------------------------- 广州移动 traceroute to 211.139.145.34 (211.139.145.34), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 china-mobile.as58453.any2ix.coresite.com (206.72.210.219) 8.26 ms http: json http: json 6 223.120.6.17 8.43 ms http: json http: json 7 223.120.12.106 161.20 ms http: json http: json 8 221.183.55.82 154.17 ms http: json http: json 9 221.183.25.118 149.19 ms http: json http: json 10 221.183.68.138 157.76 ms http: json http: json 11 111.24.4.245 155.53 ms http: json http: json 12 * 13 211.136.208.13 157.75 ms http: json http: json 14 211.136.249.109 159.72 ms http: json http: json 15 120.198.206.158 162.25 ms http: json http: json 16 211.139.130.202 161.68 ms http: json http: json 17 221.179.44.57 168.59 ms http: json http: json 18 * 19 * 20 * 21 * 22 * 23 * 24 * 25 * 26 * 27 * 28 * 29 * 30 * ---------------------------------------------------------------------- 上海电信 traceroute to 101.95.120.109 (101.95.120.109), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 et-0-0-61.cr3-lax2.ip4.gtt.net (76.74.41.89) 12.62 ms http: json http: json 6 218.30.54.72 2.26 ms http: json http: json 7 202.97.83.241 13.66 ms http: json http: json 8 202.97.41.201 132.23 ms http: json http: json 9 * 10 202.97.57.150 140.92 ms http: json http: json 11 * 12 101.95.120.109 139.21 ms http: json http: json ---------------------------------------------------------------------- 上海联通 traceroute to 211.95.72.254 (211.95.72.254), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 et-0-0-61.cr3-lax2.ip4.gtt.net (76.74.41.89) 0.50 ms http: json http: json 6 ae10.cr4-lax2.ip4.gtt.net (89.149.130.90) 3.07 ms http: json http: json 7 as4837.cr4-lax2.ip4.gtt.net (173.241.128.46) 3.33 ms http: json http: json 8 219.158.96.29 174.02 ms http: json http: json 9 219.158.96.210 170.30 ms http: json http: json 10 219.158.103.217 174.06 ms http: json http: json 11 219.158.6.233 177.33 ms http: json http: json 12 * 13 112.64.246.218 176.97 ms http: json http: json 14 * 15 * 16 * 17 * 18 * 19 * 20 * 21 * 22 * 23 * 24 * 25 * 26 * 27 * 28 * 29 * 30 * ---------------------------------------------------------------------- 上海移动 traceroute to 183.192.160.3 (183.192.160.3), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 * 6 china-mobile.as58453.any2ix.coresite.com (206.72.210.219) 8.25 ms http: json http: json 7 223.120.6.17 8.39 ms http: json http: json 8 223.120.13.46 179.27 ms http: json http: json 9 221.183.55.30 157.44 ms http: json http: json 10 221.183.25.189 160.92 ms http: json http: json 11 221.176.22.9 186.26 ms 12 111.24.3.81 187.94 ms 13 * 14 117.185.10.242 190.47 ms 15 120.204.194.14 208.26 ms 16 120.204.197.126 187.81 ms 17 * 18 * 19 * 20 * 21 * 22 * 23 * 24 * 25 * 26 * 27 * 28 * 29 * 30 * ---------------------------------------------------------------------- 成都教育网 traceroute to 202.112.14.151 (202.112.14.151), 30 hops max, 60 byte packets 1 * 2 * 3 * 4 * 5 xe-0-0-22-0.a00.lsanca07.us.bb.gin.ntt.net (129.250.207.189) 0.34 ms 6 ae-7.r24.lsanca07.us.bb.gin.ntt.net (129.250.2.105) 1.31 ms 7 ae-1.r00.lsanca07.us.bb.gin.ntt.net (129.250.3.17) 0.93 ms 8 * 9 38.88.196.186 162.26 ms 10 101.4.117.169 163.19 ms 11 101.4.117.97 166.56 ms 12 101.4.114.170 167.15 ms 13 101.4.112.14 181.92 ms 14 101.4.112.18 200.87 ms 15 101.4.116.158 196.22 ms 16 * 17 * 18 * 19 202.112.14.151 188.85 ms
二、脚本备份
如果需要修改自定义节点只需修改“ip_list”后面的IP地址和“ip_addr”后面的对应节点名称即可。另外“for i in”后面的 {0..15}根据自己的测试节点数量要填写清楚,像陌涛修改后是16个节点,数字是0…15,如果你修改后是18个节点那么对应的数字是0…17。
#!/bin/bash # apt -y install unzip # install besttrace if [ ! -f "besttrace" ]; then wget https://github.com/motao123/VPS-/raw/master/besttrace # unzip besttrace4linux.zip chmod +x besttrace fi ## start to use besttrace next() { printf "%-70s\n" "-" | sed 's/\s/-/g' } clear next ip_list=(220.181.22.1 61.181.81.1 221.130.33.1 60.176.0.1 60.12.17.1 211.140.0.2 58.42.224.1 58.16.28.1 211.139.0.10 14.215.116.1 58.250.0.1 211.139.145.34 101.95.120.109 211.95.72.254 183.192.160.3 202.112.14.151) ip_addr=(北京电信 天津联通 北京移动 杭州电信 宁波联通 杭州移动 贵阳电信 贵阳联通 贵阳移动 广州电信 深圳联通 广州移动 上海电信 上海联通 上海移动 成都教育网) # ip_len=${#ip_list[@]} for i in {0..15} do echo ${ip_addr[$i]} ./besttrace -q 1 ${ip_list[$i]} next done
发表回复