{"id":169,"date":"2025-04-25T15:02:03","date_gmt":"2025-04-25T07:02:03","guid":{"rendered":"https:\/\/blog.unicom.cloudns.be\/?p=169"},"modified":"2025-04-25T15:27:24","modified_gmt":"2025-04-25T07:27:24","slug":"%e4%bd%bf%e7%94%a8iperf3%e8%bf%9b%e8%a1%8c%e5%b8%a6%e5%ae%bd%e6%b5%8b%e8%af%95","status":"publish","type":"post","link":"https:\/\/blog.unicom.cloudns.be\/?p=169","title":{"rendered":"\u4f7f\u7528iperf3\u8fdb\u884c\u5e26\u5bbd\u6d4b\u8bd5"},"content":{"rendered":"<h1>\u4e00\u3001\u73af\u5883<\/h1>\n<ul>\n<li>Ubuntu\u670d\u52a1\u5668A IP\u5730\u5740\uff1a1.1.1.1  <\/li>\n<li>Ubuntu\u670d\u52a1\u5668B IP\u5730\u5740\uff1a2.2.2.2  <\/li>\n<li>\u4e24\u53f0\u670d\u52a1\u5668\u5747\u6709\u9632\u706b\u5899\uff0c\u4f7f\u75285201\u7aef\u53e3\u8fdb\u884c\u6d4b\u8bd5<\/li>\n<\/ul>\n<h1>\u4e8c\u3001\u6d4b\u8bd5\u76ee\u6807<\/h1>\n<ol>\n<li>\u5206\u522b\u6d4b\u8bd5\u670d\u52a1\u5668A \u2192 \u670d\u52a1\u5668B\u7684TCP\u3001UDP\u5e26\u5bbd\uff1b<\/li>\n<li>\u5206\u522b\u6d4b\u8bd5\u670d\u52a1\u5668B \u2192 \u670d\u52a1\u5668A\u7684TCP\u3001UDP\u5e26\u5bbd\u3002<\/li>\n<\/ol>\n<h1>\u4e09\u3001\u6d4b\u8bd5\u6b65\u9aa4<\/h1>\n<ol>\n<li>\u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5iperf3\n<pre><code>$ apt install iperf3<\/code><\/pre>\n<\/li>\n<li>\u6253\u5f00\u670d\u52a1\u5668\u9632\u706b\u5899\u7aef\u53e3\n<pre><code>$ iptables -I INPUT -p tcp --dport 5201 -j ACCEPT\n$ iptables -I INPUT -p udp --dport 5201 -j ACCEPT<\/code><\/pre>\n<\/li>\n<li>\u5e26\u5bbd\u6d4b\u8bd5<br \/>\n\u5728\u670d\u52a1\u5668A\u4e0a\u6267\u884c\uff1a<\/p>\n<pre><code>$ iperf3 -s<\/code><\/pre>\n<p>\u6d4b\u8bd5\u670d\u52a1\u5668B \u2192 \u670d\u52a1\u5668A\u7684TCP\u5e26\u5bbd\uff0c\u5728\u670d\u52a1\u5668B\u4e0a\u6267\u884c\uff1a<\/p>\n<pre><code>$ iperf3 -c 1.1.1.1 -p 5201 -b 10M -t 30 -i 1 -l 128<\/code><\/pre>\n<p>\u6d4b\u8bd5\u670d\u52a1\u5668B \u2192 \u670d\u52a1\u5668A\u7684UDP\u5e26\u5bbd\uff0c\u5728\u670d\u52a1\u5668B\u4e0a\u6267\u884c\uff1a<\/p>\n<pre><code>$ iperf3 -c 1.1.1.1 -u -p 5201 -b 10M -t 30 -i 1 -l dynamic<\/code><\/pre>\n<p>\u6d4b\u8bd5\u670d\u52a1\u5668A \u2192 \u670d\u52a1\u5668B\u7684TCP\u5e26\u5bbd\uff0c\u5728\u670d\u52a1\u5668B\u4e0a\u6267\u884c\uff1a<\/p>\n<pre><code>$ iperf3 -c 1.1.1.1 -p 5201 -b 10M -t 30 -i 1 -l 128 -R<\/code><\/pre>\n<p>\u6d4b\u8bd5\u670d\u52a1\u5668A \u2192 \u670d\u52a1\u5668B\u7684UDP\u5e26\u5bbd\uff0c\u5728\u670d\u52a1\u5668B\u4e0a\u6267\u884c\uff1a<\/p>\n<pre><code>$ iperf3 -c 1.1.1.1 -u -p 5201 -b 10M -t 30 -i 1 -l dynamic -R<\/code><\/pre>\n<\/li>\n<li>\u6062\u590d\u670d\u52a1\u5668\u9632\u706b\u5899\u72b6\u6001\uff0c\u5728\u4e24\u53f0\u670d\u52a1\u5668\u4e0a\u6267\u884c\uff1a\n<pre><code>$ iptables -D INPUT -p tcp --dport 5201 -j ACCEPT<\/code><\/pre>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u73af\u5883 Ubuntu\u670d\u52a1\u5668A IP\u5730\u5740\uff1a1.1.1.1 Ubuntu\u670d\u52a1\u5668B IP\u5730\u5740\uff1a2.2.2.2 \u4e24\u53f0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-169","post","type-post","status-publish","format-standard","hentry","category-7"],"_links":{"self":[{"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=\/wp\/v2\/posts\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=169"}],"version-history":[{"count":2,"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=\/wp\/v2\/posts\/169\/revisions"}],"predecessor-version":[{"id":171,"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=\/wp\/v2\/posts\/169\/revisions\/171"}],"wp:attachment":[{"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.unicom.cloudns.be\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}