Pergunta

Is there a way to force an iperf client to use a specific port number as its outgoing port instead of letting iperf on choosing a random port to use?

Foi útil?

Solução

Actually neither of these answers is correct: they specify the destination port, not the client port. It seems client port is random (but consistent in one run), without a way to specify it

Update 2019: recent versions --cport option to specify client port

Outras dicas

iperf 3 user documentation https://iperf.fr/iperf-doc.php reveals you can assign a specific client port with --cport <port> and -B --bind option. Check iperf3 user documentation for further details. Here is an example of using client's port number 5500.

Server runs on 10.0.0.2:

> iperf3 -s 

Client runs on 10.0.0.1:

> iperf3 -c 10.0.0.2 -B 10.0.0.1 --cport 5500
-p, --port #    $IPERF_PORT The server port for the server to listen on and the client to connect to. This should be the same in both client and server. Default is 5001, the same as ttcp.

-p option denotes the port # to be use in client or server.Then you need to set the same port to server side and client site.

For example Server

iperf -s -p 10000

Client

iperf -c SERVER_IP -p 10000 -t60
iperf -c <remoteip> --port <remoteport> -B <localbindip>:<localbindport>

I have been able to do this using the above.

try: server side-

iperf -s -i1 -fm -w512k -p1

client side-

iperf -c <ipadr> -i1 -fm -w512k -p1

-p option indicates port no.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top