Speedtest / Bench Test

,

Hey all

I’m trying to run a speedtest on Vyos but keep getting an error.

I’m not keen on installing the speedtest-cli on the router itself, so I tried using bench.sh:

curl -Lso- bench.sh | bash

Which happens to use speedtest-cli without actually installing it. However, the router always returns this error:

main: line 215: 17263 Segmentation fault wget --no-check-certificate -q -T10 -O speedtest.tgz ${url1}
main: line 215: 17264 Segmentation fault wget --no-check-certificate -q -T10 -O speedtest.tgz ${url2}
Error: Failed to download speedtest-cli.

Any thoughts? This seems to work on all other machines except the vyos ones.

I don’t really understand this thing of running speedtest ON the router. It’s not very reflective given that that packets still have to egress the router thorough an interface to be useful.

Anyway, if you want to do this, why not just copy the speedtest binary to /config/scripts ?

I have a restic binary in mine, so that every night the router backs up its config using the vyos cron.

I would suggest you’re trying to be too tricky - download the ookla binary (not the github one it doesn’t give very good performance anymore) and copy the speedtest binary directly to your router.

I realise this doesn’t answer the “Why am I getting segfaults” question - I don’t know the answer to that, does “sudo dmesg” give any details?

If you want to measure the routing/forwarding performance of the router, you need to perform a speedtest from a client on the LAN to/from the WAN. Speedtests on the router itself only measures how fast the router can generate or receive traffic, not how fast it would be able to deliver internet traffic to your LAN clients. :slight_smile:

One way running a speedtest on the router itself can be somewhat useful (if you don’t have another server for it) is as a comparative tool to notify you of any large differences in the results between consecutive scheduled runs. Is that what you are looking to do? :slight_smile:

please could you write the commands to do that ?

thanks

Can’t you google it?

Speedtest CLI: Internet speed test for the command line

i’ve just done, thanks

I meaned how to download and unzip on vyos cli.

It’s just a standard linux box, you can just

scp speedtest-cli username@router:/config/scripts

etc. There’s nothing extra special about it.

configure
set system name-server 8.8.8.8
commit
save
exit
mkdir /config/speedtest
cd /config/speedtest
wget https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-x86_64.tgz
tar -xzvf ookla-speedtest-1.2.0-linux-x86_64.tgz
rm ookla-speedtest-1.2.0-linux-x86_64.tgz

Run:

/config/speedtest/speedtest --accept-license -f json

You can then use a python script to parse the information from the json.

You’re running into a couple of fundamental issues here - both technical and architectural.Use iperf3 for LAN-to-WAN Testing

The Segmentation fault on wget usually happens because bench.sh relies on specific environment binaries, shared libraries, or SSL/TLS execution hooks that aren’t fully available or behave differently in VyOS’s restricted shell environment.

If you must test bandwidth between network segments, use iperf3. You can run an iperf3 server on a device on one side and a client on the other:

# On Receiver:
iperf3 -s

# On Sender:
iperf3 -c <receiver_ip> -P 4

Test throughput THROUGH the router, not ON the router!

You can also try something like:

VyOS1 <> VyOS2 <> VyOS3

And then on VyOS3 run:

monitor bandwidth-test accept udp 

and on VyOS1 run:

monitor bandwidth-test initiate udp <ip>

Above will be using iperf, not sure if its iperf (2.1.8) or iperf3 (3.12) but both exists if you prefer to run iperf/iperf3 natively.

Protip I think its iperf3 that misbehaves on windows (or if its the other way around) so try both when benchmarking (specially if windows clients are involved).

Other than that you can use a container in VyOS for speedtesting, examples: