2012-04-08 4869 views

回答

5

这些答案其实也不是正确的:他们指定的目的港,而不是客户端端口。这似乎客户端端口是随机的(但在一个运行一致),若没有指定它

-1

尝试: 服务器副作用

iperf -s -i1 -fm -w512k -p1 

客户副作用

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

-p选项表示端口号。

+0

这不是一个明确的答案。您为客户端指定的端口是客户端连接到目标主机时将使用的端口。这里的问题是,我们是否可以*强制*客户端将本地端点连接到特定的端口。 – KZcoding 2015-09-17 19:19:43

4
-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选项表示要在客户端或服务器中使用的端口号。然后您需要将相同的端口设置为服务器端和客户端站点。

例如 服务器

iperf -s -p 10000 

客户

iperf -c SERVER_IP -p 10000 -t60 
3

的iperf 3用户文档https://iperf.fr/iperf-doc.php表明您可以指定一个特定的客户端端口--cport <port>-B --bind选项。查看iperf3用户文档以获取更多详细信息。下面是使用在10.0.0.2 5500

服务器运行客户端的端口号的例子:

> iperf3 -s 

客户端上运行10.0.0.1:

> iperf3 -c 10.0.0.2 -B 10.0.0.1 --cport 5500 
+0

你愿意解释-p和--cport之间的区别吗?谢谢 – borgmater 2017-10-26 11:33:06

+0

'--cport'是IPERF3中的一个选项,用于指定客户端端口,而'-p'或'--port'用于指定服务器端口。更多信息请参阅[链接](https://iperf.fr/iperf-doc.php)。 – talpur99 2017-10-27 17:39:34