如何指定iperf客户端端口

时间:2012-04-08 18:44:45

标签: client port

有没有办法强制iperf客户端使用特定的端口号作为其传出端口,而不是让iperf选择使用的随机端口?

5 个答案:

答案 0 :(得分:6)

iperf 3用户文档https://iperf.fr/iperf-doc.php显示您可以使用--cport <port>-B --bind选项分配特定的客户端端口。查看iperf3用户文档以获取更多详细信息。以下是使用客户端端口号5500的示例。

服务器在10.0.0.2上运行:

> iperf3 -s 

客户端在10.0.0.1上运行:

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

答案 1 :(得分:5)

实际上这些答案都不正确:它们指定目标端口,而不是客户端端口。似乎客户端端口是随机的(但在一次运行中是一致的),没有指定它的方法

更新2019 :最新版本 - 指定客户端端口的

答案 2 :(得分: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 :(得分:0)

iperf -c <remoteip> --port <remoteport> -B <localbindip>:<localbindport>

我已经可以使用上面的方法做到这一点。

答案 4 :(得分:-2)

尝试: 服务器端 -

iperf -s -i1 -fm -w512k -p1

客户端 -

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

-p选项表示端口号

相关问题