Installing speedtest-cli on a USG-PRO-4

I received an email from today Xfinity/Comcast letting me know that they increased my internet speeds, all for free. I made a screenshot of the email that was sent, as shown in the image below.

Installing speedtest-cli on a USG-PRO-4 1

As with most things that Xfinity/Comcast promises I am skeptical since I currently am paying for their top tier 1000Mb/40Mb connection speed and have yet to ever be able to achieve that successfully. With that being said I know that they always come back to troubleshoot and state that the connection is fine and that it must be an issue with my hardware. The troubleshooting usually comes down to them stating I need to connect my computer directly to the modem via ethernet and then run a speed test, the main issue with that is that almost all my devices with displays are wireless and everything else is more or less a headless Linux install.

I figured before going through all of the back and forth of resetting things, unplugging network equipment, and all that fun stuff I would run a speed test from my USG-Pro-4, sadly the UI speed test rarely if ever works, and while there is command-line access they do not have a direct way to run the test that I was able to find.

Enter speedtest-cli

The script speedtest-cli which was created by Matt Martz aka Sivel on most all networks allows for you to run a speed test from the command line with ease, and the best part is that it runs out of the box on the USG-Pro-4 without any tweaks or configuration changes. In order to get this installed on the USG-Pro-4 is as simple as issuing the following commands once you have connected into your USG-Pro-4 via SSH.

curl -O https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod a+rx speedtest.py
sudo mv speedtest.py /usr/local/bin/speedtest-cli

After performing the install you can now run the speed test from the command line of the USG-Pro-4 like so

speedtest-cli --no-pre-allocate

If everything goes as planned you will finally be presented with results much like the following, and as you will see in my case I am not getting speeds that Xfinity/Comcast was telling me that I should end up having.

[email protected]:~$ speedtest-cli --no-pre-allocate
Retrieving speedtest.net configuration...
Testing from Comcast Cable (XX.XX.XX.XX)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by University of Michigan (Ann Arbor, MI) [72.22 km]: 21.07 ms
Testing download speed................................................................................
Download: 286.38 Mbit/s
Testing upload speed................................................................................................
Upload: 33.29 Mbit/s
[email protected]:~$

And while I am certain that my network is setup in an optimal way on both the physical setup, but also the software side of things I guess this is a better time than ever to confirm everything before reaching out to Xfinity/Comcast support to only be told to reboot my modem and my router. Fingers crossed and I hopefully will have a follow up feel good post showing some better overall speeds within my house… also hoping this does not drive me to purchase more new shiney hardware just to rule out any uhhhh dated hardware 😛

*Note I removed my IP from the speed test results.