0
0
Linux-cliHow-ToBeginner · 3 min read

How to Check Network Speed on Linux: Simple Commands

To check network speed on Linux, use the speedtest-cli command for an easy internet speed test or iperf3 for detailed local network speed testing. Install these tools via your package manager and run speedtest-cli or iperf3 -s and iperf3 -c [server] to measure speed.
📐

Syntax

Here are the basic commands to check network speed on Linux:

  • speedtest-cli: Runs an internet speed test using Speedtest.net servers.
  • iperf3 -s: Starts an iperf3 server to listen for speed test connections.
  • iperf3 -c [server_address]: Connects to an iperf3 server to measure network speed.

Replace [server_address] with the IP or hostname of the iperf3 server.

bash
speedtest-cli

iperf3 -s
iperf3 -c [server_address]
💻

Example

This example shows how to run a quick internet speed test using speedtest-cli. It measures your download and upload speeds.

bash
speedtest-cli
Output
Retrieving speedtest.net configuration... Testing from Your ISP (Your IP)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by Example Server (City) [10.00 km]: 10.123 ms Testing download speed................................................................................ Download: 85.23 Mbit/s Testing upload speed................................................................................................ Upload: 12.45 Mbit/s
⚠️

Common Pitfalls

Common mistakes when checking network speed on Linux include:

  • Not installing the required tools first (e.g., speedtest-cli or iperf3).
  • Running iperf3 -c without a running iperf3 -s server to connect to.
  • Confusing internet speed tests with local network speed tests; speedtest-cli tests internet speed, while iperf3 tests local network speed.

Always ensure you have the right tool for your testing goal.

bash
## Wrong: Running iperf3 client without server
iperf3 -c 192.168.1.100

## Right: Start server first in another terminal
iperf3 -s

## Then run client
iperf3 -c 192.168.1.100
📊

Quick Reference

Summary of commands to check network speed on Linux:

CommandPurpose
speedtest-cliTest internet download and upload speed using Speedtest.net
iperf3 -sStart iperf3 server to listen for speed tests
iperf3 -c [server]Run iperf3 client to test speed to a server
ifstatShow real-time network interface bandwidth usage (not speed test)
ethtool [interface]Show network interface speed and settings

Key Takeaways

Use speedtest-cli for quick internet speed tests on Linux.
Use iperf3 with a server and client setup to test local network speed.
Always install the required tools before running speed tests.
Do not confuse internet speed tests with local network speed tests.
Check interface speed with ethtool for hardware link speed info.