How can I stop iperf server when it finishes?

Ander Galisteo picture Ander Galisteo · Oct 5, 2016 · Viewed 19.9k times · Source

Once the client finishes the process is automatically closed. I would like to do the same thing in the server side, because I want to automatize some processes, but the server side finishes but remains open.

Answer

user3480788 picture user3480788 · Apr 21, 2019

In iperf3, you can just give the -1 parameter and it will close automatically. It only accepts one connection and it will exit when that is finished.

Example: % iperf3 -s -B 192.168.20.10 -p 70011 -1