Linux 安裝 speedtest-cli 測試網際網路速度

如果是使用 rhel, centos, rocky版本,用下列指令安裝:

[root@liho ~]# dnf install epel-release -y
[root@liho ~]# dnf install speedtest-cli -y

如果是使用 ubuntu 版本,用下列指令安裝:

foo@liho:~$ sodo apt install speedtest-cli -y

然後用 speedtest-cli 指令測試速度

root@liho:~# speedtest-cli
Retrieving speedtest.net configuration...
Testing from Chunghwa Telecom (125.x.x.x)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Taiwan Mobile (Taipei) [1.90 km]: 5.749 ms
Testing download speed................................................................................
Download: 218.65 Mbit/s
Testing upload speed......................................................................................................
Upload: 225.76 Mbit/s

如果有遇到 403: Forbidden 問題:

Cannot retrieve speedtest configuration
ERROR: HTTP Error 403: Forbidden

就需要改用 speedtest-cli –secure 指令:

[root@liho ~]# speedtest-cli --secure
Retrieving speedtest.net configuration...
Testing from XXX (140.x.x.x)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Chief Telecom (Taipei) [1.90 km]: 3.206 ms
Testing download speed................................................................................
Download: 730.89 Mbit/s
Testing upload speed......................................................................................................
Upload: 782.02 Mbit/s