Operations 5 min read

How to Quickly Test Network Speed on Linux Using Ping, Curl, iperf, and iftop

Learn several straightforward Linux commands—ping for latency, curl or wget for download throughput, iperf for precise bandwidth measurement, and iftop for real‑time traffic monitoring—to accurately assess network speed and stability, with example syntax and usage tips for both client and server setups.

ITPUB
ITPUB
ITPUB
How to Quickly Test Network Speed on Linux Using Ping, Curl, iperf, and iftop

Linux provides a variety of simple yet powerful tools for measuring network performance. Depending on whether you need latency, download/upload throughput, or detailed bandwidth statistics, you can choose the appropriate command.

Ping for basic latency

The built‑in ping command sends ICMP echo requests to a target host and reports round‑trip time (RTT) in milliseconds. Example: ping www.baidu.com The output shows the time value for each reply; lower values indicate lower latency. Packet loss or "Request timeout" messages suggest instability, but ping does not measure bandwidth.

Ping command output
Ping command output

curl or wget for download speed

To gauge download throughput, use curl or wget with a large test file. The command streams the file to /dev/null so no storage is used, while the terminal displays the transfer rate.

curl -o /dev/null http://speed.hetzner.de/100MB.bin

This downloads a 100 MB file from Hetzner and reports the speed in bytes per second, giving a practical estimate of your download capacity.

curl download speed output
curl download speed output

iperf for precise bandwidth testing

iperf

is a dedicated network performance tool, ideal for measuring bandwidth between two devices on a LAN or across the internet. Install it on both the server and client machines.

Start the server:

iperf -s
iperf server mode
iperf server mode

On the client, connect to the server’s IP address: iperf -c SERVER_IP_ADDRESS The client sends data to the server and, upon completion, displays detailed results including bandwidth (typically in Mbps), total transferred data, and test duration.

iperf client results
iperf client results

For upload testing, add the -u flag for UDP mode and optionally set bandwidth with -b. Use -t to change test duration (default 10 s) and -P to run multiple parallel streams.

iftop for real‑time traffic monitoring

The iftop utility shows live bandwidth usage per connection on a network interface. After installing, run: sudo iftop The interface displays current upload and download rates for each peer, helping you observe overall load and identify bottlenecks.

iftop traffic monitor
iftop traffic monitor

Conclusion

By selecting the appropriate tool—ping for latency, curl/wget for download speed, iperf for detailed bandwidth, or iftop for continuous monitoring—you can quickly and accurately assess network performance on any Linux system.

pingLinuxcurlNetwork Speediftopiperf
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

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.