I would use a network bandwidth monitoring tool instead, e.g. iperf3.
You can run the server instance of it on any of the hosts and from the client decide which direction bandwidth you like to meassure.
on one of the hosts to use it as the server run:
iperf3 --server
It will by default listen on port 5201/tcp so that need to be allowed from the other host.
on the other machine to test upstream bandwidth over tcp in it's simplest form:
iperf3 --client serveraddr
where serveraddr is the ip address (or hostname or fqdn) of the machine running the iperf3 server.
To test downstream bandwidth to the client do:
iperf3 --client serveraddr --reverse
Both directions:
iperf3 --client serveraddr --bidir
iperf3 has loads of options to tweak how much data should be transferred, which protocol and ports to use, etc and you can "daemonize" it on the server-side to have it always listen for client connections in the background ... man iperf3
is your friend :-)
iperf3 is OpenSource, it's available in most distributions and also has binaries to download for e.g. Windows and MacOS
I find it very reliable (at least on Linux) and I use it all the time, not only to measure throughput but also to see where we have packet loss, etc.
Here's the home page:
https://software.es.net/iperf/