Bash – Internet speed test from bash/linux command line hangs

bashpingpython

I am running this python script on a remote ubuntu server from command line for speed testing:

https://github.com/sivel/speedtest-cli

with:

$ curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -
Retrieving speedtest.net configuration...
Testing from Microsoft Corporation (x.x.x.x)...
Retrieving speedtest.net server list...
Selecting best server based on ping...

But it just hangs. I have then tried ( 5463) Linkem SPA (Rome, Italy)):

$ python3 speedtest.py 5463
Retrieving speedtest.net configuration...
Testing from Microsoft Corporation (x.x.x.x)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by Linkem SPA (Rome) [1297.45 km]: 1800000.0 ms
Testing download speed................................................................................
Download: 0.00 Mbit/s
Testing upload speed

So its not connected at all. Also running:

$ ping sl-03.wemacom.de

Or:

$ hping3 sl-03.wemacom.de
HPING sl-03.wemacom.de (eth0 46.30.119.166): NO FLAGS are set, 40 headers + 0 data bytes

Or:

$ hping3 sl-03.wemacom.de --syn -p 8080

just hangs. On my local machine it works fine:

$ ping sl-03.wemacom.de
PING sl-03.wemacom.de (46.30.119.166) 56(84) bytes of data.
64 bytes from sl-03.wemacom.de (46.30.119.166): icmp_seq=1 ttl=53 time=42.6 ms
64 bytes from sl-03.wemacom.de (46.30.119.166): icmp_seq=2 ttl=53 time=44.4 ms

Maybe I need to run the test one layer up – e.g. on TCP level – on this machine?

Best Answer

I had the same problem. I checked my firewall and I saw some outgoing TCP 8080 traffic blocked. Then I allowed it and it worked... If I block outgoing TCP 8080 again, the test hangs like before.