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.
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?
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!
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: