Start Netcat to Listen
I’m going to use a utility called netcat, or nc to listen on a particular network port on the Desktop machine. Enter the following command into a terminal on Desktop:
This tells the Desktop machine to listen for network traffic on port 2112 and to keep listening. Any output is sent to /dev/null.
Linux network speed test: dd and netcat
Now that the first machine, Desktop, is set up to listen, I’ll use the second machine, Laptop, to send and receive data to test the network. The command below assumes that the IP address for Desktop is 192.168.2.2. Adjust the address accordingly for your network. From a terminal on Laptop, enter the following:
The first part of the command tells the machine to copy 10 megabytes of data from /dev/zero in 16 kilobyte blocks. The part after the pipe tells it to send that to the Desktop machine over port 2112.
You should see output similar to the screen shot below. In my case it showed that my wireless network is performing at 8.9 megabytes per second, or 71.2 megabits per second.
Once you’re done testing, go to the terminal on Desktop and use [Ctrl]+C to stop netcat.