What's new

Speedtest Command Line Using CLI Tool

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

icehacker

Occasional Visitor
Hi Guys,

Just tested this tool works great. Just wanted to share

# REF http://www.tecmint.com/check-internet-speed-from-command-line-in-linux/
# login to router via ssh

ipkg update
ipkg upgrade
ipkg install python
cd /opt
wget https://github.com/sivel/speedtest-cli/archive/master.zip
unzip master.zip
cd speedtest-cli-master/
chmod 755 speedtes*.py
mv speedtest.py /opt/bin/.
cd/
speedtest.py

# ----------------------------- OutPut Begin -----------------------------
# Retrieving speedtest.net configuration...
# Testing from <Your ISP Name> (xxx.xxx.xxx.xxx)...
# Retrieving speedtest.net server list...
# Selecting best server based on ping...
# Hosted by <Company / Site Information> (<Location Of Server>) [8.28 km]: 11.302 ms
# Testing download speed................................................................................
# Download: 23.48 Mbit/s
# Testing upload speed....................................................................................................
# Upload: 23.29 Mbit/s
# ----------------------------- OutPut End -------------------------------

# Gives a approx 99% accuracy

HTH
icehacker
 
Or from a Pi...

sudo apt-get update && sudo apt-get install iperf3

Then to check upstream...

Code:
$ iperf3 -c iperf.he.net
Connecting to host iperf.he.net, port 5201
[  4] local 192.168.1.147 port 45530 connected to 216.218.227.10 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  1.56 MBytes  13.1 Mbits/sec    2   38.2 KBytes      
[  4]   1.00-2.00   sec  1.14 MBytes  9.53 Mbits/sec    1   43.8 KBytes      
[  4]   2.00-3.00   sec  1.18 MBytes  9.90 Mbits/sec    3   46.7 KBytes      
[  4]   3.00-4.00   sec  1.10 MBytes  9.20 Mbits/sec    4   33.9 KBytes      
[  4]   4.00-5.00   sec  1.10 MBytes  9.20 Mbits/sec    3   38.2 KBytes      
[  4]   5.00-6.00   sec  1.10 MBytes  9.22 Mbits/sec    5   39.6 KBytes      
[  4]   6.00-7.00   sec   844 KBytes  6.92 Mbits/sec   19   45.2 KBytes      
[  4]   7.00-8.00   sec  1.10 MBytes  9.24 Mbits/sec    2   46.7 KBytes      
[  4]   8.00-9.00   sec  1.37 MBytes  11.5 Mbits/sec    1   49.5 KBytes      
[  4]   9.00-10.00  sec  1.10 MBytes  9.21 Mbits/sec    3   24.0 KBytes      
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  11.6 MBytes  9.70 Mbits/sec   43             sender
[  4]   0.00-10.00  sec  10.8 MBytes  9.04 Mbits/sec                  receiver

And for downstream (from server to client)

Code:
$ iperf3 -c iperf.he.net -R
Connecting to host iperf.he.net, port 5201
Reverse mode, remote host iperf.he.net is sending
[  4] local 192.168.1.147 port 45540 connected to 216.218.227.10 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec  6.20 MBytes  52.0 Mbits/sec                 
[  4]   1.00-2.00   sec  8.06 MBytes  67.6 Mbits/sec                 
[  4]   2.00-3.00   sec  8.18 MBytes  68.6 Mbits/sec                 
[  4]   3.00-4.00   sec  8.76 MBytes  73.4 Mbits/sec                 
[  4]   4.00-5.00   sec  8.63 MBytes  72.4 Mbits/sec                 
[  4]   5.00-6.00   sec  8.62 MBytes  72.3 Mbits/sec                 
[  4]   6.00-7.00   sec  8.08 MBytes  67.8 Mbits/sec                 
[  4]   7.00-8.00   sec  8.64 MBytes  72.5 Mbits/sec                 
[  4]   8.00-9.00   sec  8.70 MBytes  73.0 Mbits/sec                 
[  4]   9.00-10.00  sec  8.71 MBytes  73.0 Mbits/sec                 
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  85.3 MBytes  71.5 Mbits/sec   76             sender
[  4]   0.00-10.00  sec  83.1 MBytes  69.7 Mbits/sec                  receiver
 
Hi Guys,

Just tested this tool works great. Just wanted to share

# REF http://www.tecmint.com/check-internet-speed-from-command-line-in-linux/
# login to router via ssh

ipkg update
ipkg upgrade
ipkg install python
cd /opt
wget https://github.com/sivel/speedtest-cli/archive/master.zip
unzip master.zip
cd speedtest-cli-master/
chmod 755 speedtes*.py
mv speedtest.py /opt/bin/.
cd/
speedtest.py

# ----------------------------- OutPut Begin -----------------------------
# Retrieving speedtest.net configuration...
# Testing from <Your ISP Name> (xxx.xxx.xxx.xxx)...
# Retrieving speedtest.net server list...
# Selecting best server based on ping...
# Hosted by <Company / Site Information> (<Location Of Server>) [8.28 km]: 11.302 ms
# Testing download speed................................................................................
# Download: 23.48 Mbit/s
# Testing upload speed....................................................................................................
# Upload: 23.29 Mbit/s
# ----------------------------- OutPut End -------------------------------

# Gives a approx 99% accuracy

HTH
icehacker
Python on my router. No thanks. Don't want to reward the hackers too much now (see recent threads).
 
Python on my router. No thanks. Don't want to reward the hackers too much now (see recent threads).

Any kind of package manager can add more risk...

The real thing is to reduce the threat surface in the first place... most of the folks that got hit there were exposing services they probably should not have...
 
Any kind of package manager can add more risk...

The real thing is to reduce the threat surface in the first place... most of the folks that got hit there were exposing services they probably should not have...
True. Think they should be removed from public use in routers. Wcb Access, AiCloud...
 
True. Think they should be removed from public use in routers. Wcb Access, AiCloud...

Yes and no... there's utility for some items, but those connections should be initiated from inside the LAN, and with appropriate credentials and security..

Part of the challenge here is that some vendors do make this very easy not to do the right thing in a security oriented perspective - they offer the features, but don't advise about the risks...
 
this is pretty interesting. can anyone point out any security risks of using this method for speed tests? i'm guessing the python package is probably one?
 
this is pretty interesting. can anyone point out any security risks of using this method for speed tests? i'm guessing the python package is probably one?

Any time someone adds a package manager, this can introduce risks...

Python and the package trees by themselves are relatively safe - but some who gets into the box - either from the WAN side (if services are exposed) or from the LAN side (through clever things) - the more capability that is added is additional tools for everyone that has access...

Comes down to what one wants from a gateway/firewall - I'm inclined to believe that least-privilege concepts apply on a gateway...
 
Any time someone adds a package manager, this can introduce risks...

Python and the package trees by themselves are relatively safe - but some who gets into the box - either from the WAN side (if services are exposed) or from the LAN side (through clever things) - the more capability that is added is additional tools for everyone that has access...

Comes down to what one wants from a gateway/firewall - I'm inclined to believe that least-privilege concepts apply on a gateway...

So, you believe a router should route. Not control your VPN, SSH, etc...? that's what i'm getting from this.
 
So, you believe a router should route. Not control your VPN, SSH, etc...? that's what i'm getting from this.

yes...

It'll be faster, more secure, and stable...

VPN, SSH, etc.. can all be done with another box behind the router/GW/firewall itself - and then forward the ports as needed if one has a need.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top