Operations 8 min read

Testing Local Network Speed on Linux, Windows, and macOS with Speedtest-cli & iPerf

This guide explains how to measure local network speed on Linux, Windows, and macOS using command‑line tools like speedtest-cli and iPerf, graphical apps, PowerShell, Wireshark, and provides advanced tips for optimization and monitoring.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Testing Local Network Speed on Linux, Windows, and macOS with Speedtest-cli & iPerf

Testing Local Network Speed on Linux

Speedtest-cli

Speedtest-cli ( https://github.com/sivel/speedtest-cli) is a command‑line utility that measures download and upload bandwidth by connecting to the nearest Speedtest server.

sudo apt-get install speedtest-cli
speedtest-cli

iperf

iperf ( https://iperf.fr) provides detailed performance metrics such as bandwidth, latency, and packet loss. Install it, start a server, then run a client against the server.

sudo apt-get install iperf
iperf -s
iperf -c <server_ip>

Testing Local Network Speed on Windows

Using the Speedtest App

Open a browser to https://www.speedtest.net, click the “Go” button, and view download, upload, and latency results.

PowerShell basic test

Run the following command to test connectivity, latency, and bandwidth to a target host.

Test-NetConnection -ComputerName example.com -Port 80

iPerf for Windows

Download the Windows binary from https://iperf.fr/iperf-download.php, install it, then start a server and client.

iperf -s
iperf -c <server_ip>

Testing Local Network Speed on macOS

Speedtest by Ookla App

Visit https://www.speedtest.net or download the app from the Mac App Store, then click “Go” to run the test.

Terminal basic test

Download a test file to gauge download speed.

curl -o /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip

Install and run iPerf via Homebrew

Install Homebrew from https://brew.sh, then install iPerf, start the server, and run the client.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install iperf
iperf -s
iperf -c <server_ip>

Advanced Testing Methods and Additional Tools

Wireshark

Install Wireshark ( https://www.wireshark.org), capture traffic on the appropriate interface, and analyze packets for detailed performance insights.

Ping for latency

ping <target_ip>

iPerf UDP test

Enable UDP testing with the -u flag to evaluate real‑time applications.

iperf -u -c <server_ip>

Network Optimization

Optimize network settings

Adjust MTU size : view current size with ip link show and change it, e.g., sudo ip link set dev eth0 mtu 1500.

Enable Jumbo frames : ensure all network devices support Jumbo frames and configure them where possible.

Use caching and CDN

Local cache : employ a proxy such as Squid on Linux/macOS to reduce external requests.

CDN : deploy static assets to services like Cloudflare, Akamai, or Amazon CloudFront for faster delivery.

Update drivers and firmware

Keep network‑adapter drivers and router/switch firmware up to date to avoid performance regressions.

Monitor network performance

Collect and visualize metrics with Prometheus ( https://prometheus.io) and Grafana ( https://grafana.com) to quickly spot and resolve issues.

LinuxWindowsWiresharkmacOSnetwork testingiperfspeedtest-cli
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.