Netcat para teste de velocidade de rede

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:

nc -lk 2112 >/dev/null

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 Adjust the address accordingly for your network. From a terminal on Laptop, enter the following:

dd if=/dev/zero bs=16000 count=625 | nc -v 2112

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.

Related Posts

Deixe um comentário