Skip to main content

speedtest-cli how to

Comments

11 comments

  • cPRex Jurassic Moderator
    Hey there! Attempting to disable the firewall is a good idea, as that can be done temporarily while you perform the test. I do also need to point out that this wouldn't be related to the cPanel software on the machine. If this is a Ubuntu system, you may need some additional packages for that tool to work properly:
    0
  • SimpleTechGuy
    @cPRex, thanks for looking into this for me!
    If this is a Ubuntu system, you may need some additional packages for that tool to work properly:

    Sorry, forgot to mention it's running CentOS 7
    Hey there! Attempting to disable the firewall is a good idea

    Thanks! Disabled the firewall in csf - ConfigServer Firewall
    and speedtest worked, looks like firewall was blocking it somehow.
    I do also need to point out that this wouldn't be related to the cPanel software on the machine.

    Yes, sorry about that, since this server is only used for WHM/Cpanel I just default to coming here when there is an issue. I guess I figured it must have been the firewall settings in WHM that was blocking it. Maybe I should go over to ConfigServer forums for this?
    0
  • SimpleTechGuy
    So in testing I found that in CSF Firewall Configuration the Allow outgoing TCP ports
    is limited to certain ports. When I checked the logs /var/logs/messages
    when attempting to run speedtest-cli
    I found it was using random source ports in the upper 55000 range. So I guess that explains the issue. So for future reference, instead of disabling the firewall for the test, a person could temporarily add all outgoing ports: TCP_OUT=1:65535 UDP_OUT=1:65535
    to ConfigServer Security & Firewall - csf - Firewall Configuration - IPv4 Port Settings - TCP_OUT and UDP_OUT
    Then just remember to remove the ports you added from the firewall configuration when done testing.
    0
  • cPRex Jurassic Moderator
    I'm glad you were able to track that down!
    0
  • Spirogg
    So in testing I found that in CSF Firewall Configuration the Allow outgoing TCP ports
    is limited to certain ports. When I checked the logs /var/logs/messages
    when attempting to run speedtest-cli
    I found it was using random source ports in the upper 55000 range. So I guess that explains the issue. So for future reference, instead of disabling the firewall for the test, a person could temporarily add all outgoing ports: TCP_OUT=1:65535 UDP_OUT=1:65535
    to ConfigServer Security & Firewall - csf - Firewall Configuration - IPv4 Port Settings - TCP_OUT and UDP_OUT
    Then just remember to remove the ports you added from the firewall configuration when done testing.

    as per the speedtest website: ports 8080 or 5060 need to be open in /out in firewall [to run test run the commands below] speedtest cli ( this will choose an automatic location for you and run the test) speedtest cli --servers ( this will give you a list of server you can choose from to run your test) speedtest cli --server-id=10723 ( this will run a test on this selected server ) here is xml page with server ID's I found online. This will get you a list of servers - ID's close to your location
    0
  • SimpleTechGuy
    my servers test results PING ms 2 DOWNLOAD Mbps 9301.83 UPLOAD Mbps 8698.72

    First of all, WOW, I've never even seen a 10gig connection before, So Jealous! lol, If you ever need anyone to play on your network let me know! :cool: I'm supposed to be on a 1 gig server, but I guess it's just a busy farm here because my best results so far have been: Download: 530.73 Upload: 352.18
    as per the speedtest website: ports 8080 or 5060 need to be open in /out in firewall

    You are awesome! I did see those ports were required on speedtest-cli from github, and I didn't install anything, just downloaded the python script and marked it executable. So Thank you so much @Spirogg for all that information!!
    0
  • Spirogg
    If you ever need anyone to play on your network let me know! :cool:

    Thanks and sure why not. Lol I"m glad it helps and thanks for your info as well ;)
    So For me the command for listing servers was speedtest-cli --list
    , and to run on selected server was speedtest-cli --server 'id'
    but that could be different because I used the version of
    0
  • SimpleTechGuy
    Thanks and sure why not. Lol

    Nice! Tried to PM you but doesn't look like it's allowed on your account. Was going to ask about that 10g network and also about xenspec.
    0
  • Spirogg
    Nice! Tried to PM you but doesn't look like it's allowed on your account. Was going to ask about that 10g network and also about xenspec.

    I just turn on in privacy settings to allow PM but I tried to send you one and did not work either in privacy settings says ( start conversations with you I tried followers and now tried members only. and still could not send to you a PM. so maybe on your end you have to make this change as well? or the forum is not working right -05-07 at 12.30.30 AM.png">77753
    0
  • Spirogg
    Update on installing speedtest.net speedtest on Almalinux - not from yum or dnf first go to speedtest.net/apps/cli
    then at bottom of the page you will see Download for Linux in the dropdown find X86_64
    and right mouse click on the downloadable file to copy the link only
    next login to WHM terminal and mkdir speedtest
    then cd /speedtest
    then type: wget https://install.speedtest.net/app/cli/ookla-speedtest-1.1.1-linux-x86_64.tgz
    ( this is the file you right moused click to copy the url. you can paste it after wget ) then tar -xvzf ookla-speedtest-1.1.1-linux-x86_64.tgz
    - ( just fyi dir or ls while in speedtest directory you created to see the correct file name to use incase the file gets updated ) then chmod +x speedtest
    then mv speedtest /usr/bin
    last type: speedtest
    to run the test. that's it!! as mentioned earlier [per the speedtest,net website] ports 8080 or 5060
    need to be open in /out in firewall [to run test run the commands below] speedtest
    ( this will choose an automatic location for you and run the test) speedtest --servers
    ( this will give you a list of server you can choose from to run your test) speedtest --server-id=10723
    ( this will run a test on this selected server ) * (10723 is an example of the server id number from the --servers list you got running speedtest --servers
    )
    here is xml page with server ID's I found online. This will get you a list of server ID's close to your location.
    0
  • SimpleTechGuy
    Excellent instructions! Thanks for sharing. I verified this does work on my system as well. Just one note:
    ports 8080 or 5060
    need to be open in /out in firewall

    I only had to allow the ports outbound, opening inbound ports is generally not required unless you're going to host a speedtest server, but just for testing speeds you should only need outbound ports open in csf.
    0

Please sign in to leave a comment.