• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Speedtest CLI. Run speedtest on pfSense box

pfSense Packages
52
167
136.5k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    carbonejf @carbonejf
    last edited by Mar 25, 2021, 1:57 PM

    I have a solution, I installed the ookla pkg and now I receive data again (with pfsense 2.5.0).
    First I removed speedtest and after I installed ookla version (cf https://www.speedtest.net/apps/cli pkg add ookla-speedtest-1.0.0-freebsd.pkg).
    I made some adaptation in script and now I have result :)
    🔒 Log in to view

    1 Reply Last reply Reply Quote 0
    • M
      MarcO42
      last edited by Apr 13, 2021, 10:08 AM

      Hi,
      since a few day I got this:

      [2.5.1-RC][admin@router.local]/usr/local/bin: /usr/local/bin/speedtest-cli
      Retrieving speedtest.net configuration...
      Traceback (most recent call last):
        File "/usr/local/bin/speedtest-cli", line 11, in <module>
          load_entry_point('speedtest-cli==2.1.2', 'console_scripts', 'speedtest-cli')()
        File "/usr/local/lib/python3.7/site-packages/speedtest.py", line 1986, in main
          shell()
        File "/usr/local/lib/python3.7/site-packages/speedtest.py", line 1875, in shell
          secure=args.secure
        File "/usr/local/lib/python3.7/site-packages/speedtest.py", line 1091, in __init__
          self.get_config()
        File "/usr/local/lib/python3.7/site-packages/speedtest.py", line 1174, in get_config
          map(int, server_config['ignoreids'].split(','))
      ValueError: invalid literal for int() with base 10: ''
      

      Any ideas how to fix this?
      Cheers
      MarcO

      J 1 Reply Last reply Apr 13, 2021, 10:14 AM Reply Quote 0
      • J
        johnpoz LAYER 8 Global Moderator @MarcO42
        last edited by Apr 13, 2021, 10:14 AM

        @marco42

        see here
        https://forum.netgate.com/post/976739

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.7.2, 24.11

        M 1 Reply Last reply Apr 13, 2021, 10:21 AM Reply Quote 1
        • M
          MarcO42 @johnpoz
          last edited by Apr 13, 2021, 10:21 AM

          @johnpoz
          Many thx. That fixed my issue. :)

          1 Reply Last reply Reply Quote 0
          • A
            ashima LAYER 8
            last edited by Jul 15, 2021, 6:45 AM

            Hello everyone,
            Thank you for pointing to Speedtest by Ookla.

            Issue facing:

            Pfsense Version : 2.4.5

            WAN Interface : WAN1 and WAN2 (both 300Mbps line)

            Tested : speedtest-cli works fine with either of the Wans. When WAN1 is primary, I can test WAN2 speed using
            speedtest-cli --source <interface ip>
            I get the right results.

            Upgraded to Pfsense version 2.5.2

            I can only test the primary line. Speedtest-cli gives < 1 Mbps for secondary line. If I make WAN2 as primary the speedtest-cli result with WAN1 gives < 1 Mbps.

            I get similar result with speedtest by OOkla. So I guess the issue is with pfsense blocking the secondary line.

            Is there any work around.

            Ashima (Pronet Services)

            1 Reply Last reply Reply Quote 0
            • S
              stephenw10 Netgate Administrator
              last edited by Jul 15, 2021, 4:16 PM

              Is it actually binding to the WAN2 IP and NATing out of the WAN1 address?

              That could imply there is no gateway on the WAN2 interface.

              Steve

              A 1 Reply Last reply Jul 20, 2021, 6:48 AM Reply Quote 0
              • A
                ashima LAYER 8 @stephenw10
                last edited by Jul 20, 2021, 6:48 AM

                Replying late as I got locked out of Netgate forum stating my ip is banned by community. I tried access using my mobile data but still with same error. Anyway it's working now... :)

                @stephenw10 Sorry, but not sure whether I could really follow your reply.

                When WAN1 is down, WAN2 automatically starts working. So I guess no issue with Natting. Speedtest-cli is then able to give right result for WAN2.

                Basically Speedtest-cli is able to give the right result for active gateway (WAN1 or WAN2). Doesn't show right result for other Wan (WAN1 or WAN2).

                Also I am able to ping from both the interface with either of Wan active .

                This was not the case with pfsense 2.4.5. I still have a machine with older pfsense(2.4.5). Its working fine there.

                Ashima(Pronet Services)

                1 Reply Last reply Reply Quote 0
                • S
                  stephenw10 Netgate Administrator
                  last edited by Jul 20, 2021, 4:26 PM

                  I'm suggesting that Speedtest could be using the correct source IP but that traffic is still using the default route via WAN1. Check the state table when you're testing to see if that traffic is being NAT'd from the WAN2 address to the WAN1 address.
                  That would not normally be possible though. The auto outbound NAT rules on WAN1 would not include the WAN2 address.

                  Steve

                  1 Reply Last reply Reply Quote 0
                  • J
                    jpass0222
                    last edited by Jul 20, 2021, 5:38 PM

                    Just set up on Version 2.6.0-DEVELOPMENT (amd64)

                    🔒 Log in to view

                    Really nice, thanks


                    Intel(R) Xeon(R) CPU D-1541 @ 2.10GHz
                    Current: 2100 MHz, Max: 2101 MHz
                    16 CPUs: 1 package(s) x 8 core(s) x 2 hardware threads
                    AES-NI CPU Crypto: Yes (active)
                    QAT Crypto: No

                    1 Reply Last reply Reply Quote 0
                    • C
                      cyphonsqr
                      last edited by cyphonsqr Sep 4, 2021, 4:31 AM Sep 4, 2021, 4:10 AM

                      @aln Thanks for your plugin.
                      I just installed it but couldn't get it working with the latest speedtest for FreeBSD (https://www.speedtest.net/apps/cli).
                      I manually edited 1 line in the php ( $results = shell_exec("speedtest -f json");), but got stuck there.

                      Many thanks if you (or anyone) can offer support. :)

                      Edit: In the interim, it did work using the earlier speedtest-cli ( pkg install -y py38-speedtest-cli-2.1.3 ) and unedited php 😊

                      1 Reply Last reply Reply Quote 0
                      • U
                        user747
                        last edited by user747 Jun 3, 2022, 6:56 PM Jun 3, 2022, 6:33 PM

                        Sorry, but had to interject here. It seem @johnpoz has a very narrow view of what pfsense is, despite being a forum mod.
                        Maybe due to supporting a majority of non-technical users, he only sees the cases where pfsense is used on the bare minimum hardware and only for IP routing.
                        The reality of pfsense is that it is also for power users. Maybe they @johnpoz doesn't hear about the advanced use cases as much.

                        Using pfsense to perform periodic ISP speed tests is absolutely a fair ask.
                        pfsense has packages that make it way more than just a router.

                        In addition to "just being a router" it is also a DHCP server of course, but also can be:

                        • Web Server
                        • Captive Portal
                        • DNS Server
                        • RADIUS Authentication Server
                        • Gateway monitoring Daemon
                        • Squid Proxy
                        • NG Firewall (pfblocker)
                        • Dynamic DNS Client
                        • VPN Client and VPN Server
                        • and much, much more.

                        Yes, all of these services running does require good hardware, but not even a full desktop sucking down 95W. A mini PC like a NUC does work great.

                        pfsense IS SUPPOSED to also be a client in many situations. VPN is a good example. It's OpenVPN package allows a user to create a persistent VPN client on the pfsense to a VPN provider on the Internet. That's more resource intensive than a periodic speedtest.

                        And the built in "dpinger" Gateway Monitoring Daemon has the sole purpose of keeping an eye on the WAN gateways to see if they go down. It pings the ISP periodically. A periodic speedtest would be a natural extension of this function. DDNS is another client that goes out to a service on the internet to update the Public IP.
                        So it is absolutely a proper request that a speedtest client be an available feature.

                        Regarding "slow results" from speedtest-cli running on the pfsense, this is due to the sivel package being old/buggy and not using the closest servers compared to the Speedtest.net website and/or the Ookla provided cli client.

                        Power users understand that speedtest.net isn't going to be 100% perfect, but it does provide a source of trending data that will help users if they need to show their ISP that they are not getting what they pay for.

                        1 Reply Last reply Reply Quote 1
                        • bearhntrB bearhntr referenced this topic on Sep 13, 2022, 5:20 PM
                        • S stephenw10 referenced this topic on Sep 15, 2022, 12:35 PM
                        • S stephenw10 referenced this topic on Sep 15, 2022, 12:35 PM
                        • provelsP provels referenced this topic on Sep 15, 2022, 1:09 PM
                        • E
                          Elrick75 @aln
                          last edited by Elrick75 Dec 21, 2022, 1:18 PM Dec 21, 2022, 1:04 PM

                          @aln

                          Hello to all,

                          My need : Evaluate the speed of my ISP directly on my firewall because my machines are behind other network equipments (Switch, ect...).
                          My hardware, a DELL R230 server (CPU E3-1260L v5 @ 2.90GHz) with pfSense 2.6.0-RELEASE (amd64) FreeBSD 12.3-STABLE.

                          After a quick search on google, I installed the speeptest package by following some tutorials found everywhere from the Diagnostics > Command Prompt menu
                          Unfortunately I have a message ERROR: Unable to connect to servers to test latency.
                          Is there any specific opening to do for the application to work? Someone can help me to open it properly from pfSense please?
                          If not, someone can tell me more ?

                          I ran the following commands:

                          Translated with www.DeepL.com/Translator (free version)

                          # pkg search speedtest
                          py38-speedtest-cli-2.1.3 Command line interface for testing internet bandwidth

                          # pkg install -y py38-speedtest-cli-2.1.3

                          # speedtest-cli
                          Retrieving speedtest.net configuration...
                          Testing from Free SAS (82.xx.xx.xx)...
                          Retrieving speedtest.net server list...
                          Selecting best server based on ping...
                          ERROR: Unable to connect to servers to test latency.

                          # speedtest --version
                          speedtest-cli 2.1.3
                          Python 3.8.12 (default, Jan 12 2022, 15:22:58) [Clang 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611a

                          Best Regards.

                          J fireodoF 2 Replies Last reply Dec 21, 2022, 1:13 PM Reply Quote 0
                          • J
                            Jarhead @Elrick75
                            last edited by Dec 21, 2022, 1:13 PM

                            @elrick75
                            That package is extremely old and may not still work with current BSD versions. I haven't tried it so I can't say for sure, but this one from Ookla does work.
                            https://www.speedtest.net/apps/cli

                            1 Reply Last reply Reply Quote 0
                            • fireodoF
                              fireodo @Elrick75
                              last edited by fireodo Dec 21, 2022, 1:16 PM Dec 21, 2022, 1:16 PM

                              @elrick75 Try

                              speedtest --secure
                              

                              Kettop Mi4300YL CPU: i5-4300Y @ 1.60GHz RAM: 8GB Ethernet Ports: 4
                              SSD: SanDisk pSSD-S2 16GB (ZFS) WiFi: WLE200NX
                              pfsense 2.7.2 CE
                              Packages: Apcupsd Cron Iftop Iperf LCDproc Nmap pfBlockerNG RRD_Summary Shellcmd Snort Speedtest System_Patches.

                              E 1 Reply Last reply Dec 21, 2022, 1:18 PM Reply Quote 0
                              • E
                                Elrick75 @fireodo
                                last edited by Dec 21, 2022, 1:18 PM

                                @fireodo said in Speedtest CLI. Run speedtest on pfSense box:

                                speedtest --secure

                                Same result :

                                Retrieving speedtest.net configuration...
                                Testing from Free SAS (82.xx.xx.xx)...
                                Retrieving speedtest.net server list...
                                Selecting best server based on ping...
                                ERROR: Unable to connect to servers to test latency.
                                
                                fireodoF 1 Reply Last reply Dec 21, 2022, 1:23 PM Reply Quote 0
                                • fireodoF
                                  fireodo @Elrick75
                                  last edited by Dec 21, 2022, 1:23 PM

                                  @elrick75 said in Speedtest CLI. Run speedtest on pfSense box:

                                  @fireodo said in Speedtest CLI. Run speedtest on pfSense box:

                                  speedtest --secure

                                  Same result :

                                  Retrieving speedtest.net configuration...
                                  Testing from Free SAS (82.xx.xx.xx)...
                                  Retrieving speedtest.net server list...
                                  Selecting best server based on ping...
                                  ERROR: Unable to connect to servers to test latency.
                                  

                                  Can you reach speedtest.net in a browser? Perhaps something in your system is blocking the access to that server.

                                  Kettop Mi4300YL CPU: i5-4300Y @ 1.60GHz RAM: 8GB Ethernet Ports: 4
                                  SSD: SanDisk pSSD-S2 16GB (ZFS) WiFi: WLE200NX
                                  pfsense 2.7.2 CE
                                  Packages: Apcupsd Cron Iftop Iperf LCDproc Nmap pfBlockerNG RRD_Summary Shellcmd Snort Speedtest System_Patches.

                                  E 1 Reply Last reply Dec 21, 2022, 1:24 PM Reply Quote 0
                                  • E
                                    Elrick75 @fireodo
                                    last edited by Elrick75 Dec 21, 2022, 1:26 PM Dec 21, 2022, 1:24 PM

                                    @fireodo said in Speedtest CLI. Run speedtest on pfSense box:

                                    speedtest.net

                                    I reach it... https://www.speedtest.net/ works fine

                                    @jarhead
                                    How to install it ?

                                    fireodoF 1 Reply Last reply Dec 21, 2022, 1:25 PM Reply Quote 0
                                    • fireodoF
                                      fireodo @Elrick75
                                      last edited by Dec 21, 2022, 1:25 PM

                                      @elrick75 said in Speedtest CLI. Run speedtest on pfSense box:

                                      @fireodo said in Speedtest CLI. Run speedtest on pfSense box:

                                      speedtest.net

                                      I reach it... https://www.speedtest.net/ works fine

                                      Hmmm ...

                                      Kettop Mi4300YL CPU: i5-4300Y @ 1.60GHz RAM: 8GB Ethernet Ports: 4
                                      SSD: SanDisk pSSD-S2 16GB (ZFS) WiFi: WLE200NX
                                      pfsense 2.7.2 CE
                                      Packages: Apcupsd Cron Iftop Iperf LCDproc Nmap pfBlockerNG RRD_Summary Shellcmd Snort Speedtest System_Patches.

                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        stephenw10 Netgate Administrator
                                        last edited by Dec 21, 2022, 4:23 PM

                                        The speedtest pkg in out repo works fine here:

                                        [22.05-RELEASE][admin@fw1.stevew.lan]/root: pkg-static install py38-speedtest-cli
                                        Updating pfSense-core repository catalogue...
                                        pfSense-core repository is up to date.
                                        Updating pfSense repository catalogue...
                                        pfSense repository is up to date.
                                        All repositories are up to date.
                                        The following 1 package(s) will be affected (of 0 checked):
                                        
                                        New packages to be INSTALLED:
                                        	py38-speedtest-cli: 2.1.3 [pfSense]
                                        
                                        Number of packages to be installed: 1
                                        
                                        38 KiB to be downloaded.
                                        
                                        Proceed with this action? [y/N]: y
                                        [1/1] Fetching py38-speedtest-cli-2.1.3.pkg: 100%   38 KiB  39.0kB/s    00:01    
                                        Checking integrity... done (0 conflicting)
                                        [1/1] Installing py38-speedtest-cli-2.1.3...
                                        [1/1] Extracting py38-speedtest-cli-2.1.3: 100%
                                        [22.05-RELEASE][admin@fw1.stevew.lan]/root: rehash
                                        [22.05-RELEASE][admin@fw1.stevew.lan]/root: speedtest-cli
                                        Retrieving speedtest.net configuration...
                                        Testing from Plusnet (X.X.X.X)...
                                        Retrieving speedtest.net server list...
                                        Selecting best server based on ping...
                                        Hosted by Jump Networks Ltd (London) [9.58 km]: 9.422 ms
                                        Testing download speed................................................................................
                                        Download: 61.69 Mbit/s
                                        Testing upload speed......................................................................................................
                                        Upload: 18.83 Mbit/s
                                        

                                        Steve

                                        E 1 Reply Last reply Dec 22, 2022, 7:47 AM Reply Quote 0
                                        • Sergei_ShablovskyS
                                          Sergei_Shablovsky @jimp
                                          last edited by Sergei_Shablovsky Dec 22, 2022, 12:00 AM Dec 21, 2022, 11:58 PM

                                          @jimp said in Speedtest CLI. Run speedtest on pfSense box:

                                          That looks nice, though it's usually better to test bandwidth through the firewall and not from the firewall itself. pfSense has been optimized to work in a routing role, so sometimes you might see reduced numbers when pfSense itself is acting like the client.

                                          Dear John!

                                          With all my honor and appreciate to You.

                                          As we had discuss some time before, there are two points of view on TESTING link parameters:

                                          1. From border firewall to outside (in our case pfSense);
                                          2. Through border firewall to outside (mean nearest ISP fiber splitter/switch/router)

                                          I have a thought that approximately 85-90% of this pfSense users forum mean “WHAT IS EXACTLY MY UPLINK BANDWIDTH” when thinking about link bandwidth testing services like speedtest/fast/librespeed.

                                          And only we “squeeze” as much as possible from ISP uplink (this mean cabling, good connectors, may be spending hours on ISP hotline to resolve some issue on ISP hardware You connected up...), we must doing next step to “WHAT IS PING/BANDWIDTH FROM MY PC TO IP/ADDRESS OUTSIDE AND BACK”.

                                          This mean we quickly goes to “rabbit hole” for newbies “WHATS GOING ON INSIDE PFSENSE SERVER” (this mean adjustments of Settings, tune limits, etc...).

                                          So logically looks like BOTH OF THIS TESTING ARE NEEDED.

                                          —
                                          CLOSE SKY FOR UKRAINE https://youtu.be/_tU1i8VAdCo !
                                          Help Ukraine to resist, save civilians people’s lives !
                                          (Take an active part in public protests, push on Your country’s politics, congressmans, mass media, leaders of opinion.)

                                          J 1 Reply Last reply Dec 22, 2022, 12:24 AM Reply Quote 0
                                          • First post
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.